{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 多维数据的可视化\n",
    "\n",
    "* 所谓多维，就是数据不仅仅有x,y两列，而是有多列数据特征需要展示。这里主要分为两类展示方法，一类是用多张图展示多个数据，一类是一张图上展示多列数据。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import json\n",
    "from pandas.io.json import json_normalize\n",
    "from collections import Counter"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 单图中多列数据并列\n",
    "\n",
    "* 男鞋商品搜索数据\n",
    "\n",
    "* 每一列对应的是搜索下的某个商品"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "#导入男鞋数据\n",
    "op1=open(r'D:\\try\\shoes.json', 'r',encoding='utf-8')\n",
    "li=[]\n",
    "dict1={}\n",
    "for i in op1:\n",
    "    k=json.loads(i.encode(\"utf-8\"))#把字符串转换为json\n",
    "    li.append(k)\n",
    "a=json_normalize(li)#把由json数据构成的列表转换成数据框"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [],
   "source": [
    "#help(a.sort_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>_id.$oid</th>\n",
       "      <th>info.上市年份季节</th>\n",
       "      <th>info.上市时间</th>\n",
       "      <th>info.产品名称</th>\n",
       "      <th>info.低帮鞋品名</th>\n",
       "      <th>info.功能</th>\n",
       "      <th>info.吊牌价</th>\n",
       "      <th>info.品牌</th>\n",
       "      <th>info.图案</th>\n",
       "      <th>info.场合</th>\n",
       "      <th>...</th>\n",
       "      <th>info.鞋面材质</th>\n",
       "      <th>info.颜色分类</th>\n",
       "      <th>info.风格</th>\n",
       "      <th>itemid</th>\n",
       "      <th>location</th>\n",
       "      <th>nick</th>\n",
       "      <th>price</th>\n",
       "      <th>sales</th>\n",
       "      <th>title</th>\n",
       "      <th>url</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5aa77041be9b0338dc1faab4</td>\n",
       "      <td>2018年春季</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>商务休闲鞋</td>\n",
       "      <td>轻质</td>\n",
       "      <td>NaN</td>\n",
       "      <td>YEARCON/意尔康</td>\n",
       "      <td>纯色</td>\n",
       "      <td>日常</td>\n",
       "      <td>...</td>\n",
       "      <td>头层牛皮（除牛反绒）</td>\n",
       "      <td>黑色土黄</td>\n",
       "      <td>商务</td>\n",
       "      <td>562121114807</td>\n",
       "      <td>浙江 丽水</td>\n",
       "      <td>意尔康皮鞋旗舰店</td>\n",
       "      <td>269.00</td>\n",
       "      <td>1583人付款</td>\n",
       "      <td>意尔康男鞋2018春季新款英伦真皮商务休闲皮鞋青年男士皮鞋子男潮</td>\n",
       "      <td>http://detail.tmall.com/item.htm?id=5621211148...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 52 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                   _id.$oid info.上市年份季节 info.上市时间 info.产品名称 info.低帮鞋品名  \\\n",
       "0  5aa77041be9b0338dc1faab4     2018年春季       NaN       NaN      商务休闲鞋   \n",
       "\n",
       "  info.功能 info.吊牌价      info.品牌 info.图案 info.场合  \\\n",
       "0      轻质      NaN  YEARCON/意尔康      纯色      日常   \n",
       "\n",
       "                         ...                           info.鞋面材质 info.颜色分类  \\\n",
       "0                        ...                          头层牛皮（除牛反绒）      黑色土黄   \n",
       "\n",
       "  info.风格        itemid location      nick   price    sales  \\\n",
       "0      商务  562121114807    浙江 丽水  意尔康皮鞋旗舰店  269.00  1583人付款   \n",
       "\n",
       "                              title  \\\n",
       "0  意尔康男鞋2018春季新款英伦真皮商务休闲皮鞋青年男士皮鞋子男潮   \n",
       "\n",
       "                                                 url  \n",
       "0  http://detail.tmall.com/item.htm?id=5621211148...  \n",
       "\n",
       "[1 rows x 52 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "nick\n",
       "意尔康皮鞋旗舰店            289\n",
       "米兰多格商场              158\n",
       "意尔康男鞋旗舰店            149\n",
       "顺时针方向感              145\n",
       "黛露伊人                143\n",
       "皮鞋大王001             137\n",
       "万达百货品牌              136\n",
       "tb69314507          122\n",
       "卓诗尼550723290        117\n",
       "奇趣泡泡屋               117\n",
       "雪贝莲鞋服包              116\n",
       "宏图商贸8001            116\n",
       "lxylclxy             88\n",
       "开美服装商行               85\n",
       "承载哭泣的泪               77\n",
       "名人鞋服商贸               73\n",
       "瑜伽生活俱乐部              69\n",
       "双龙奇标                 68\n",
       "lin65475868          66\n",
       "意尔康品牌店               65\n",
       "稚尚鞋类专营店              61\n",
       "腾空梦想88               58\n",
       "诚信鞋店9196             52\n",
       "精品男鞋1店               50\n",
       "名鞋商城666              50\n",
       "跳广场舞老大妈              45\n",
       "网购啦啦啦9999            43\n",
       "丽鞋品牌店                41\n",
       "loveee68             39\n",
       "gahkj                36\n",
       "                   ... \n",
       "tianchengzaixian      1\n",
       "tb_5068471            1\n",
       "猴年猴奇迹                 1\n",
       "王朝阳1989520            1\n",
       "tb72028729            1\n",
       "珍珍恭喜发财123             1\n",
       "tb64161645            1\n",
       "温州品牌直销网店              1\n",
       "一张小钩                  1\n",
       "刘桂兰19870415           1\n",
       "杨傲淘天下                 1\n",
       "晓东no1                 1\n",
       "凯步品牌店05               1\n",
       "晨礼斌331897272          1\n",
       "冬天的菊花3                1\n",
       "你不懂外语                 1\n",
       "杏灵品牌店8                1\n",
       "以后再会2333              1\n",
       "杨从展                   1\n",
       "丰尘名鞋                  1\n",
       "法亨鞋城                  1\n",
       "中国诚信好商家               1\n",
       "不打扮不男人                1\n",
       "三马托拉机                 1\n",
       "七里香的叶惠美               1\n",
       "丁陈冷婵                  1\n",
       "丁鑫艺201482             1\n",
       "一生人梦一场                1\n",
       "一片红叶_65               1\n",
       "yesufengm             1\n",
       "Length: 482, dtype: int64"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.groupby(\"nick\").size().sort_values(ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "nick\n",
       "意尔康皮鞋旗舰店            289\n",
       "米兰多格商场              158\n",
       "意尔康男鞋旗舰店            149\n",
       "顺时针方向感              145\n",
       "黛露伊人                143\n",
       "皮鞋大王001             137\n",
       "万达百货品牌              136\n",
       "tb69314507          122\n",
       "卓诗尼550723290        117\n",
       "奇趣泡泡屋               117\n",
       "雪贝莲鞋服包              116\n",
       "宏图商贸8001            116\n",
       "lxylclxy             88\n",
       "开美服装商行               85\n",
       "承载哭泣的泪               77\n",
       "名人鞋服商贸               73\n",
       "瑜伽生活俱乐部              69\n",
       "双龙奇标                 68\n",
       "lin65475868          66\n",
       "意尔康品牌店               65\n",
       "稚尚鞋类专营店              61\n",
       "腾空梦想88               58\n",
       "诚信鞋店9196             52\n",
       "精品男鞋1店               50\n",
       "名鞋商城666              50\n",
       "跳广场舞老大妈              45\n",
       "网购啦啦啦9999            43\n",
       "丽鞋品牌店                41\n",
       "loveee68             39\n",
       "gahkj                36\n",
       "                   ... \n",
       "tianchengzaixian      1\n",
       "tb_5068471            1\n",
       "猴年猴奇迹                 1\n",
       "王朝阳1989520            1\n",
       "tb72028729            1\n",
       "珍珍恭喜发财123             1\n",
       "tb64161645            1\n",
       "温州品牌直销网店              1\n",
       "一张小钩                  1\n",
       "刘桂兰19870415           1\n",
       "杨傲淘天下                 1\n",
       "晓东no1                 1\n",
       "凯步品牌店05               1\n",
       "晨礼斌331897272          1\n",
       "冬天的菊花3                1\n",
       "你不懂外语                 1\n",
       "杏灵品牌店8                1\n",
       "以后再会2333              1\n",
       "杨从展                   1\n",
       "丰尘名鞋                  1\n",
       "法亨鞋城                  1\n",
       "中国诚信好商家               1\n",
       "不打扮不男人                1\n",
       "三马托拉机                 1\n",
       "七里香的叶惠美               1\n",
       "丁陈冷婵                  1\n",
       "丁鑫艺201482             1\n",
       "一生人梦一场                1\n",
       "一片红叶_65               1\n",
       "yesufengm             1\n",
       "Length: 482, dtype: int64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#以店铺的商品数量排序\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['_id.$oid', 'info.上市年份季节', 'info.上市时间', 'info.产品名称', 'info.低帮鞋品名',\n",
       "       'info.功能', 'info.吊牌价', 'info.品牌', 'info.图案', 'info.场合', 'info.外底材料',\n",
       "       'info.季节', 'info.尺码', 'info.帮面内里材质', 'info.帮面材质', 'info.性别',\n",
       "       'info.是否商场同款', 'info.是否瑕疵', 'info.款号', 'info.款式', 'info.流行元素',\n",
       "       'info.真皮材质工艺', 'info.细分风格', 'info.货号', 'info.跟底款式', 'info.运动系列',\n",
       "       'info.运动鞋科技', 'info.适合路面', 'info.适用对象', 'info.销售渠道类型', 'info.闭合方式',\n",
       "       'info.靴子品名', 'info.靴筒内里材质', 'info.靴筒材质', 'info.靴筒高度', 'info.鞋制作工艺',\n",
       "       'info.鞋垫材质', 'info.鞋头款式', 'info.鞋底材质', 'info.鞋码', 'info.鞋跟高',\n",
       "       'info.鞋面内里材质', 'info.鞋面材质', 'info.颜色分类', 'info.风格', 'itemid',\n",
       "       'location', 'nick', 'price', 'sales', 'title', 'url'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "t1=a[a.nick==\"意尔康皮鞋旗舰店\"].groupby(\"info.款式\").size()\n",
    "t2=a[a.nick==\"米兰多格商场\"].groupby(\"info.款式\").size()\n",
    "p0=pd.concat([t1,t2],axis=1,sort=False).fillna(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>乐福鞋</th>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>伐木鞋</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>休闲皮鞋</th>\n",
       "      <td>87.0</td>\n",
       "      <td>108.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>休闲高帮皮鞋</th>\n",
       "      <td>8.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>商务休闲鞋</th>\n",
       "      <td>38.0</td>\n",
       "      <td>9.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>工装鞋</th>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>布洛克鞋</th>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>德比鞋（正装皮鞋）</th>\n",
       "      <td>91.0</td>\n",
       "      <td>11.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>懒人鞋</th>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>户外休闲鞋</th>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>板鞋</th>\n",
       "      <td>18.0</td>\n",
       "      <td>18.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>沙滩鞋</th>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>豆豆鞋</th>\n",
       "      <td>8.0</td>\n",
       "      <td>8.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>运动休闲鞋</th>\n",
       "      <td>9.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>镂空皮鞋</th>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>高帮板鞋</th>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              0      1\n",
       "乐福鞋         3.0    1.0\n",
       "伐木鞋         1.0    0.0\n",
       "休闲皮鞋       87.0  108.0\n",
       "休闲高帮皮鞋      8.0    0.0\n",
       "商务休闲鞋      38.0    9.0\n",
       "工装鞋         0.0    2.0\n",
       "布洛克鞋        3.0    0.0\n",
       "德比鞋（正装皮鞋）  91.0   11.0\n",
       "懒人鞋         4.0    0.0\n",
       "户外休闲鞋       7.0    0.0\n",
       "板鞋         18.0   18.0\n",
       "沙滩鞋         7.0    0.0\n",
       "豆豆鞋         8.0    8.0\n",
       "运动休闲鞋       9.0    0.0\n",
       "镂空皮鞋        3.0    1.0\n",
       "高帮板鞋        2.0    0.0"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#计算上面排名前二的两个商家各个款式的对应的商品数量，并且组成矩阵，使得第一列是\"意尔康皮鞋旗舰店\"对应的商品数量，第二列是\"米兰多格商场\"的\n",
    "\n",
    "\n",
    "#注意为什么要组成数据框，这是为了可以让索引对齐"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 利用上面的数据做出如下的柱图，注意这里包含了两个商家的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.globals import ThemeType\n",
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "乐福鞋           3.0\n",
       "伐木鞋           1.0\n",
       "休闲皮鞋         87.0\n",
       "休闲高帮皮鞋        8.0\n",
       "商务休闲鞋        38.0\n",
       "布洛克鞋          3.0\n",
       "德比鞋（正装皮鞋）    91.0\n",
       "懒人鞋           4.0\n",
       "户外休闲鞋         7.0\n",
       "板鞋           18.0\n",
       "沙滩鞋           7.0\n",
       "豆豆鞋           8.0\n",
       "运动休闲鞋         9.0\n",
       "镂空皮鞋          3.0\n",
       "高帮板鞋          2.0\n",
       "工装鞋           0.0\n",
       "Name: 0, dtype: float64"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p0[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"224c24e755ca4de8b704767c406d09bd\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_224c24e755ca4de8b704767c406d09bd = echarts.init(\n",
       "                    document.getElementById('224c24e755ca4de8b704767c406d09bd'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_224c24e755ca4de8b704767c406d09bd = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "            \"data\": [\n",
       "                3.0,\n",
       "                1.0,\n",
       "                87.0,\n",
       "                8.0,\n",
       "                38.0,\n",
       "                3.0,\n",
       "                91.0,\n",
       "                4.0,\n",
       "                7.0,\n",
       "                18.0,\n",
       "                7.0,\n",
       "                8.0,\n",
       "                9.0,\n",
       "                3.0,\n",
       "                2.0,\n",
       "                0.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "            \"data\": [\n",
       "                1.0,\n",
       "                0.0,\n",
       "                108.0,\n",
       "                0.0,\n",
       "                9.0,\n",
       "                0.0,\n",
       "                11.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                18.0,\n",
       "                0.0,\n",
       "                8.0,\n",
       "                0.0,\n",
       "                1.0,\n",
       "                0.0,\n",
       "                2.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true,\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u67d0\\u5546\\u573a\\u9500\\u552e\\u60c5\\u51b5\"\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"80%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"save as image\",\n",
       "                \"type\": \"png\"\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"restore\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"data view\",\n",
       "                \"readOnly\": false\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"data zoom\",\n",
       "                    \"back\": \"data zoom restore\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "};\n",
       "                chart_224c24e755ca4de8b704767c406d09bd.setOption(option_224c24e755ca4de8b704767c406d09bd);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11366bc36d8>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bar = Bar(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "bar.add_xaxis(p0[0].index.tolist())\n",
    "bar.add_yaxis(\"意尔康皮鞋旗舰店\", p0[0].tolist())\n",
    "bar.add_yaxis(\"米兰多格商场\", p0[1].tolist())\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"某商场销售情况\"),toolbox_opts=opts.ToolboxOpts())\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"adcd4f98eb26475c9f5029975f35b2fe\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_adcd4f98eb26475c9f5029975f35b2fe = echarts.init(\n",
       "                    document.getElementById('adcd4f98eb26475c9f5029975f35b2fe'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_adcd4f98eb26475c9f5029975f35b2fe = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "            \"data\": [\n",
       "                3.0,\n",
       "                1.0,\n",
       "                87.0,\n",
       "                8.0,\n",
       "                38.0,\n",
       "                3.0,\n",
       "                91.0,\n",
       "                4.0,\n",
       "                7.0,\n",
       "                18.0,\n",
       "                7.0,\n",
       "                8.0,\n",
       "                9.0,\n",
       "                3.0,\n",
       "                2.0,\n",
       "                0.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "            \"data\": [\n",
       "                1.0,\n",
       "                0.0,\n",
       "                108.0,\n",
       "                0.0,\n",
       "                9.0,\n",
       "                0.0,\n",
       "                11.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                18.0,\n",
       "                0.0,\n",
       "                8.0,\n",
       "                0.0,\n",
       "                1.0,\n",
       "                0.0,\n",
       "                2.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true,\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_adcd4f98eb26475c9f5029975f35b2fe.setOption(option_adcd4f98eb26475c9f5029975f35b2fe);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ee39a173c8>"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f1=Bar(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "f1.add_xaxis(p0.index.tolist())\n",
    "f1.add_yaxis(\"意尔康皮鞋旗舰店\", p0[0].tolist())\n",
    "f1.add_yaxis(\"米兰多格商场\", p0[1].tolist())\n",
    "f1.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"))\n",
    "f1.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 图的布局\n",
    "\n",
    "* https://pyecharts.org/#/zh-cn/composite_charts\n",
    "\n",
    "* 我们同样也可以让多图在一个界面中显示"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 图形的并列"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 参考官网中的例子，基于上面的数据做两个商家数据的柱图并列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Grid, Line,Scatter\n",
    "\n",
    "\n",
    "def grid_horizontal() -> Grid:\n",
    "    scatter = (\n",
    "        Scatter()\n",
    "        .add_xaxis(Faker.choose())\n",
    "        .add_yaxis(\"商家A\", Faker.values())\n",
    "        .add_yaxis(\"商家B\", Faker.values())\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"Grid-Scatter\"),\n",
    "            legend_opts=opts.LegendOpts(pos_left=\"20%\"),\n",
    "        )\n",
    "    )\n",
    "    line = (\n",
    "        Line()\n",
    "        .add_xaxis(Faker.choose())\n",
    "        .add_yaxis(\"商家A\", Faker.values())\n",
    "        .add_yaxis(\"商家B\", Faker.values())\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"Grid-Line\", pos_right=\"5%\"),\n",
    "            legend_opts=opts.LegendOpts(pos_right=\"20%\"),\n",
    "        )\n",
    "    )\n",
    "\n",
    "    grid = (\n",
    "        Grid()\n",
    "        .add(scatter, grid_opts=opts.GridOpts(pos_left=\"55%\"))\n",
    "        .add(line, grid_opts=opts.GridOpts(pos_right=\"55%\"))\n",
    "    )\n",
    "    return grid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"a1d3c86c27fd4adab26f586b236d8269\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_a1d3c86c27fd4adab26f586b236d8269 = echarts.init(\n",
       "                    document.getElementById('a1d3c86c27fd4adab26f586b236d8269'), 'white', {renderer: 'canvas'});\n",
       "                var option_a1d3c86c27fd4adab26f586b236d8269 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u6cb3\\u9a6c\",\n",
       "                    31\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u87d2\\u86c7\",\n",
       "                    126\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8001\\u864e\",\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5927\\u8c61\",\n",
       "                    128\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5154\\u5b50\",\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u718a\\u732b\",\n",
       "                    107\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u72ee\\u5b50\",\n",
       "                    123\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u6cb3\\u9a6c\",\n",
       "                    54\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u87d2\\u86c7\",\n",
       "                    100\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8001\\u864e\",\n",
       "                    67\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5927\\u8c61\",\n",
       "                    48\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5154\\u5b50\",\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u718a\\u732b\",\n",
       "                    148\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u72ee\\u5b50\",\n",
       "                    102\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5468\\u4e00\",\n",
       "                    94\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e8c\",\n",
       "                    26\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e09\",\n",
       "                    63\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u56db\",\n",
       "                    112\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e94\",\n",
       "                    130\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u516d\",\n",
       "                    150\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u65e5\",\n",
       "                    86\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5468\\u4e00\",\n",
       "                    70\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e8c\",\n",
       "                    126\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e09\",\n",
       "                    70\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u56db\",\n",
       "                    108\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e94\",\n",
       "                    146\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u516d\",\n",
       "                    20\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u65e5\",\n",
       "                    110\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"left\": \"20%\"\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"right\": \"20%\"\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u6cb3\\u9a6c\",\n",
       "                \"\\u87d2\\u86c7\",\n",
       "                \"\\u8001\\u864e\",\n",
       "                \"\\u5927\\u8c61\",\n",
       "                \"\\u5154\\u5b50\",\n",
       "                \"\\u718a\\u732b\",\n",
       "                \"\\u72ee\\u5b50\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5468\\u4e00\",\n",
       "                \"\\u5468\\u4e8c\",\n",
       "                \"\\u5468\\u4e09\",\n",
       "                \"\\u5468\\u56db\",\n",
       "                \"\\u5468\\u4e94\",\n",
       "                \"\\u5468\\u516d\",\n",
       "                \"\\u5468\\u65e5\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Grid-Scatter\"\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"Grid-Line\",\n",
       "            \"right\": \"5%\"\n",
       "        }\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"left\": \"55%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"55%\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_a1d3c86c27fd4adab26f586b236d8269.setOption(option_a1d3c86c27fd4adab26f586b236d8269);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11366ba0d68>"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grid_horizontal().render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"88afd58a8fe545a3955a4b9ae492a9fe\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_88afd58a8fe545a3955a4b9ae492a9fe = echarts.init(\n",
       "                    document.getElementById('88afd58a8fe545a3955a4b9ae492a9fe'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_88afd58a8fe545a3955a4b9ae492a9fe = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"data\": [\n",
       "                3.0,\n",
       "                1.0,\n",
       "                87.0,\n",
       "                8.0,\n",
       "                38.0,\n",
       "                3.0,\n",
       "                91.0,\n",
       "                4.0,\n",
       "                7.0,\n",
       "                18.0,\n",
       "                7.0,\n",
       "                8.0,\n",
       "                9.0,\n",
       "                3.0,\n",
       "                2.0,\n",
       "                0.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"data\": [\n",
       "                1.0,\n",
       "                0.0,\n",
       "                108.0,\n",
       "                0.0,\n",
       "                9.0,\n",
       "                0.0,\n",
       "                11.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                18.0,\n",
       "                0.0,\n",
       "                8.0,\n",
       "                0.0,\n",
       "                1.0,\n",
       "                0.0,\n",
       "                2.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"left\": \"20%\"\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"right\": \"20%\"\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "        }\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"left\": \"55%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"55%\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_88afd58a8fe545a3955a4b9ae492a9fe.setOption(option_88afd58a8fe545a3955a4b9ae492a9fe);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11366de2da0>"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Bar, Grid, Line,Scatter\n",
    "\n",
    "f1=Bar()\n",
    "f1.add_xaxis(p0.index.tolist())\n",
    "f1.add_yaxis(\"意尔康皮鞋旗舰店\", p0[0].tolist())\n",
    "#f1.add_yaxis(\"米兰多格商场\", p0[1].tolist())\n",
    "f1.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"),\n",
    "                  legend_opts=opts.LegendOpts(pos_left=\"20%\"))\n",
    "\n",
    "\n",
    "f2=Bar()\n",
    "f2.add_xaxis(p0.index.tolist())\n",
    "f2.add_yaxis(\"米兰多格商场\", p0[1].tolist())\n",
    "f2.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"),\n",
    "                  legend_opts=opts.LegendOpts(pos_right=\"20%\"))\n",
    "\n",
    "g1=Grid(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "g1.add(f1, grid_opts=opts.GridOpts(pos_left=\"55%\"))\n",
    "g1.add(f2, grid_opts=opts.GridOpts(pos_right=\"55%\"))\n",
    "\n",
    "g1.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"798239c09393406baabda5acae21fe3a\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_798239c09393406baabda5acae21fe3a = echarts.init(\n",
       "                    document.getElementById('798239c09393406baabda5acae21fe3a'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_798239c09393406baabda5acae21fe3a = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"data\": [\n",
       "                3.0,\n",
       "                1.0,\n",
       "                87.0,\n",
       "                8.0,\n",
       "                38.0,\n",
       "                3.0,\n",
       "                91.0,\n",
       "                4.0,\n",
       "                7.0,\n",
       "                18.0,\n",
       "                7.0,\n",
       "                8.0,\n",
       "                9.0,\n",
       "                3.0,\n",
       "                2.0,\n",
       "                0.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"data\": [\n",
       "                1.0,\n",
       "                0.0,\n",
       "                108.0,\n",
       "                0.0,\n",
       "                9.0,\n",
       "                0.0,\n",
       "                11.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                18.0,\n",
       "                0.0,\n",
       "                8.0,\n",
       "                0.0,\n",
       "                1.0,\n",
       "                0.0,\n",
       "                2.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"left\": \"20%\"\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"right\": \"20%\"\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "        }\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"left\": \"55%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"55%\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_798239c09393406baabda5acae21fe3a.setOption(option_798239c09393406baabda5acae21fe3a);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ee393cc400>"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f1=Bar()\n",
    "f1.add_xaxis(p0.index.tolist())\n",
    "f1.add_yaxis(\"意尔康皮鞋旗舰店\", p0[0].tolist())\n",
    "f1.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"),\n",
    "                  legend_opts=opts.LegendOpts(pos_left=\"20%\"))\n",
    "\n",
    "f2=Bar()\n",
    "f2.add_xaxis(p0.index.tolist())\n",
    "f2.add_yaxis(\"米兰多格商场\", p0[1].tolist())\n",
    "f2.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"),\n",
    "                  legend_opts=opts.LegendOpts(pos_right=\"20%\"))\n",
    "\n",
    "g1=Grid(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "g1.add(f1, grid_opts=opts.GridOpts(pos_left=\"55%\"))\n",
    "g1.add(f2, grid_opts=opts.GridOpts(pos_right=\"55%\"))\n",
    "g1.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "def grid_horizontal() -> Grid:\n",
    "    scatter = (\n",
    "        Scatter()\n",
    "        .add_xaxis(Faker.choose())\n",
    "        .add_yaxis(\"商家A\", Faker.values())\n",
    "        .add_yaxis(\"商家B\", Faker.values())\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"Grid-Scatter\"),\n",
    "            legend_opts=opts.LegendOpts(pos_left=\"20%\"),\n",
    "        )\n",
    "    )\n",
    "    line = (\n",
    "        Line()\n",
    "        .add_xaxis(Faker.choose())\n",
    "        .add_yaxis(\"商家A\", Faker.values())\n",
    "        .add_yaxis(\"商家B\", Faker.values())\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"Grid-Line\", pos_right=\"5%\"),\n",
    "            legend_opts=opts.LegendOpts(pos_right=\"20%\"),\n",
    "        )\n",
    "    )\n",
    "\n",
    "    grid = (\n",
    "        Grid()\n",
    "        .add(scatter, grid_opts=opts.GridOpts(pos_left=\"55%\"))\n",
    "        .add(line, grid_opts=opts.GridOpts(pos_right=\"55%\"))\n",
    "    )\n",
    "    return grid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"b35749c78f7b4626896aa12373c914de\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_b35749c78f7b4626896aa12373c914de = echarts.init(\n",
       "                    document.getElementById('b35749c78f7b4626896aa12373c914de'), 'white', {renderer: 'canvas'});\n",
       "                var option_b35749c78f7b4626896aa12373c914de = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u886c\\u886b\",\n",
       "                    111\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6bdb\\u8863\",\n",
       "                    95\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9886\\u5e26\",\n",
       "                    83\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u88e4\\u5b50\",\n",
       "                    127\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u98ce\\u8863\",\n",
       "                    37\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                    133\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u889c\\u5b50\",\n",
       "                    43\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u886c\\u886b\",\n",
       "                    134\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6bdb\\u8863\",\n",
       "                    149\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9886\\u5e26\",\n",
       "                    117\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u88e4\\u5b50\",\n",
       "                    43\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u98ce\\u8863\",\n",
       "                    43\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                    30\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u889c\\u5b50\",\n",
       "                    139\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5468\\u4e00\",\n",
       "                    45\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e8c\",\n",
       "                    119\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e09\",\n",
       "                    124\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u56db\",\n",
       "                    24\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e94\",\n",
       "                    131\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u516d\",\n",
       "                    42\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u65e5\",\n",
       "                    38\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5468\\u4e00\",\n",
       "                    90\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e8c\",\n",
       "                    101\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e09\",\n",
       "                    120\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u56db\",\n",
       "                    23\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u4e94\",\n",
       "                    99\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u516d\",\n",
       "                    68\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u65e5\",\n",
       "                    84\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"left\": \"20%\"\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"right\": \"20%\"\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u886c\\u886b\",\n",
       "                \"\\u6bdb\\u8863\",\n",
       "                \"\\u9886\\u5e26\",\n",
       "                \"\\u88e4\\u5b50\",\n",
       "                \"\\u98ce\\u8863\",\n",
       "                \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                \"\\u889c\\u5b50\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5468\\u4e00\",\n",
       "                \"\\u5468\\u4e8c\",\n",
       "                \"\\u5468\\u4e09\",\n",
       "                \"\\u5468\\u56db\",\n",
       "                \"\\u5468\\u4e94\",\n",
       "                \"\\u5468\\u516d\",\n",
       "                \"\\u5468\\u65e5\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Grid-Scatter\"\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"Grid-Line\",\n",
       "            \"right\": \"5%\"\n",
       "        }\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"left\": \"55%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"55%\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_b35749c78f7b4626896aa12373c914de.setOption(option_b35749c78f7b4626896aa12373c914de);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ee3a20e780>"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grid_horizontal().render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.charts import Bar, Grid, Line,Scatter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"3f6871dc01914fe480bb57ff8bb0c218\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_3f6871dc01914fe480bb57ff8bb0c218 = echarts.init(\n",
       "                    document.getElementById('3f6871dc01914fe480bb57ff8bb0c218'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_3f6871dc01914fe480bb57ff8bb0c218 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"data\": [\n",
       "                3.0,\n",
       "                1.0,\n",
       "                87.0,\n",
       "                8.0,\n",
       "                38.0,\n",
       "                0.0,\n",
       "                3.0,\n",
       "                91.0,\n",
       "                4.0,\n",
       "                7.0,\n",
       "                18.0,\n",
       "                7.0,\n",
       "                8.0,\n",
       "                9.0,\n",
       "                3.0,\n",
       "                2.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"data\": [\n",
       "                1.0,\n",
       "                0.0,\n",
       "                108.0,\n",
       "                0.0,\n",
       "                9.0,\n",
       "                2.0,\n",
       "                0.0,\n",
       "                11.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                18.0,\n",
       "                0.0,\n",
       "                8.0,\n",
       "                0.0,\n",
       "                1.0,\n",
       "                0.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"right\": \"20%\"\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"left\": \"20%\"\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {},\n",
       "        {}\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"left\": \"55%\"\n",
       "        },\n",
       "        {\n",
       "            \"right\": \"55%\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_3f6871dc01914fe480bb57ff8bb0c218.setOption(option_3f6871dc01914fe480bb57ff8bb0c218);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ee35f4c630>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 图形选项卡\n",
    "\n",
    "* 参考官方选项卡例子，完成两个商家的选项卡数据展示\n",
    "\n",
    "* 这里最好重新运行上面的f1,f2作图，一是因为这里的标题不用设置偏移，并且如果不重新运行有可能出现错误"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.charts import Bar, Tab, Pie, Line"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pyecharts.charts.composite_charts.tab.Tab at 0x11366df7780>"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Tab, Pie, Line\n",
    "from pyecharts.components import Table\n",
    "\n",
    "\n",
    "def bar_datazoom_slider() -> Bar:\n",
    "    c = (\n",
    "        Bar()\n",
    "        .add_xaxis(Faker.days_attrs)\n",
    "        .add_yaxis(\"商家A\", Faker.days_values)\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"Bar-DataZoom（slider-水平）\"),\n",
    "            datazoom_opts=[opts.DataZoomOpts()],\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "\n",
    "\n",
    "def line_markpoint() -> Line:\n",
    "    c = (\n",
    "        Line()\n",
    "        .add_xaxis(Faker.choose())\n",
    "        .add_yaxis(\n",
    "            \"商家A\",\n",
    "            Faker.values(),\n",
    "            markpoint_opts=opts.MarkPointOpts(data=[opts.MarkPointItem(type_=\"min\")]),\n",
    "        )\n",
    "        .add_yaxis(\n",
    "            \"商家B\",\n",
    "            Faker.values(),\n",
    "            markpoint_opts=opts.MarkPointOpts(data=[opts.MarkPointItem(type_=\"max\")]),\n",
    "        )\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"Line-MarkPoint\"))\n",
    "    )\n",
    "    return c\n",
    "\n",
    "\n",
    "def pie_rosetype() -> Pie:\n",
    "    v = Faker.choose()\n",
    "    c = (\n",
    "        Pie()\n",
    "        .add(\n",
    "            \"\",\n",
    "            [list(z) for z in zip(v, Faker.values())],\n",
    "            radius=[\"30%\", \"75%\"],\n",
    "            center=[\"25%\", \"50%\"],\n",
    "            rosetype=\"radius\",\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "        )\n",
    "        .add(\n",
    "            \"\",\n",
    "            [list(z) for z in zip(v, Faker.values())],\n",
    "            radius=[\"30%\", \"75%\"],\n",
    "            center=[\"75%\", \"50%\"],\n",
    "            rosetype=\"area\",\n",
    "        )\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"Pie-玫瑰图示例\"))\n",
    "    )\n",
    "    return c\n",
    "\n",
    "\n",
    "def table_base() -> Table:\n",
    "    table = Table()\n",
    "\n",
    "    headers = [\"City name\", \"Area\", \"Population\", \"Annual Rainfall\"]\n",
    "    rows = [\n",
    "        [\"Brisbane\", 5905, 1857594, 1146.4],\n",
    "        [\"Adelaide\", 1295, 1158259, 600.5],\n",
    "        [\"Darwin\", 112, 120900, 1714.7],\n",
    "        [\"Hobart\", 1357, 205556, 619.5],\n",
    "        [\"Sydney\", 2058, 4336374, 1214.8],\n",
    "        [\"Melbourne\", 1566, 3806092, 646.9],\n",
    "        [\"Perth\", 5386, 1554769, 869.4],\n",
    "    ]\n",
    "    table.add(headers, rows).set_global_opts(\n",
    "        title_opts=opts.ComponentTitleOpts(title=\"Table\")\n",
    "    )\n",
    "    return table\n",
    "\n",
    "tab = Tab()\n",
    "tab.add(bar_datazoom_slider(), \"bar-example\")\n",
    "tab.add(line_markpoint(), \"line-example\")\n",
    "tab.add(pie_rosetype(), \"pie-example\")\n",
    "tab.add(table_base(), \"table-example\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "    <style>\n",
       "        .tab {\n",
       "            overflow: hidden;\n",
       "            border: 1px solid #ccc;\n",
       "            background-color: #f1f1f1;\n",
       "        }\n",
       "\n",
       "        .tab button {\n",
       "            background-color: inherit;\n",
       "            float: left;\n",
       "            border: none;\n",
       "            outline: none;\n",
       "            cursor: pointer;\n",
       "            padding: 12px 16px;\n",
       "            transition: 0.3s;\n",
       "        }\n",
       "\n",
       "        .tab button:hover {\n",
       "            background-color: #ddd;\n",
       "        }\n",
       "\n",
       "        .tab button.active {\n",
       "            background-color: #ccc;\n",
       "        }\n",
       "\n",
       "        .chart-container {\n",
       "            display: none;\n",
       "            padding: 6px 12px;\n",
       "            border-top: none;\n",
       "        }\n",
       "    </style>\n",
       "<div class=\"tab\">\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '5b213d4cd8f54ade954aa891a06112bb')\">bar-example</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, 'a62be1a506684a408184677278de43aa')\">line-example</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '01a6b65211cc42d2af788d762c63528d')\">pie-example</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '5eff6925f0124cc48e343d18609c8188')\">table-example</button>\n",
       "    </div>\n",
       "\n",
       "        <div id=\"5b213d4cd8f54ade954aa891a06112bb\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"a62be1a506684a408184677278de43aa\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"01a6b65211cc42d2af788d762c63528d\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "                <style>\n",
       "            .fl-table {\n",
       "                margin: 20px;\n",
       "                border-radius: 5px;\n",
       "                font-size: 12px;\n",
       "                border: none;\n",
       "                border-collapse: collapse;\n",
       "                max-width: 100%;\n",
       "                white-space: nowrap;\n",
       "                word-break: keep-all;\n",
       "            }\n",
       "\n",
       "            .fl-table th {\n",
       "                text-align: left;\n",
       "                font-size: 20px;\n",
       "            }\n",
       "\n",
       "            .fl-table tr {\n",
       "                display: table-row;\n",
       "                vertical-align: inherit;\n",
       "                border-color: inherit;\n",
       "            }\n",
       "\n",
       "            .fl-table tr:hover td {\n",
       "                background: #00d1b2;\n",
       "                color: #F8F8F8;\n",
       "            }\n",
       "\n",
       "            .fl-table td, .fl-table th {\n",
       "                border-style: none;\n",
       "                border-top: 1px solid #dbdbdb;\n",
       "                border-left: 1px solid #dbdbdb;\n",
       "                border-bottom: 3px solid #dbdbdb;\n",
       "                border-right: 1px solid #dbdbdb;\n",
       "                padding: .5em .55em;\n",
       "                font-size: 15px;\n",
       "            }\n",
       "\n",
       "            .fl-table td {\n",
       "                border-style: none;\n",
       "                font-size: 15px;\n",
       "                vertical-align: center;\n",
       "                border-bottom: 1px solid #dbdbdb;\n",
       "                border-left: 1px solid #dbdbdb;\n",
       "                border-right: 1px solid #dbdbdb;\n",
       "                height: 30px;\n",
       "            }\n",
       "\n",
       "            .fl-table tr:nth-child(even) {\n",
       "                background: #F8F8F8;\n",
       "            }\n",
       "        </style>\n",
       "        <div id=\"5eff6925f0124cc48e343d18609c8188\" class=\"chart-container\" style=\"\">\n",
       "            <p class=\"title\" style=\"font-size: 18px; font-weight:bold;\" > Table</p>\n",
       "            <p class=\"subtitle\" style=\"font-size: 12px;\" > </p>\n",
       "            <table class=\"fl-table\">\n",
       "    <tr>\n",
       "        <th>City name</th>\n",
       "        <th>Area</th>\n",
       "        <th>Population</th>\n",
       "        <th>Annual Rainfall</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td>Brisbane</td>\n",
       "        <td>5905</td>\n",
       "        <td>1857594</td>\n",
       "        <td>1146.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td>Adelaide</td>\n",
       "        <td>1295</td>\n",
       "        <td>1158259</td>\n",
       "        <td>600.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td>Darwin</td>\n",
       "        <td>112</td>\n",
       "        <td>120900</td>\n",
       "        <td>1714.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td>Hobart</td>\n",
       "        <td>1357</td>\n",
       "        <td>205556</td>\n",
       "        <td>619.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td>Sydney</td>\n",
       "        <td>2058</td>\n",
       "        <td>4336374</td>\n",
       "        <td>1214.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td>Melbourne</td>\n",
       "        <td>1566</td>\n",
       "        <td>3806092</td>\n",
       "        <td>646.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "        <td>Perth</td>\n",
       "        <td>5386</td>\n",
       "        <td>1554769</td>\n",
       "        <td>869.4</td>\n",
       "    </tr>\n",
       "</table>\n",
       "        </div>\n",
       "\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_5b213d4cd8f54ade954aa891a06112bb = echarts.init(\n",
       "                    document.getElementById('5b213d4cd8f54ade954aa891a06112bb'), 'white', {renderer: 'canvas'});\n",
       "                var option_5b213d4cd8f54ade954aa891a06112bb = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"data\": [\n",
       "                19,\n",
       "                4,\n",
       "                15,\n",
       "                21,\n",
       "                13,\n",
       "                4,\n",
       "                18,\n",
       "                29,\n",
       "                27,\n",
       "                21,\n",
       "                22,\n",
       "                10,\n",
       "                8,\n",
       "                14,\n",
       "                26,\n",
       "                12,\n",
       "                29,\n",
       "                16,\n",
       "                2,\n",
       "                23,\n",
       "                13,\n",
       "                21,\n",
       "                5,\n",
       "                29,\n",
       "                17,\n",
       "                27,\n",
       "                30,\n",
       "                29,\n",
       "                2,\n",
       "                20\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"0\\u5929\",\n",
       "                \"1\\u5929\",\n",
       "                \"2\\u5929\",\n",
       "                \"3\\u5929\",\n",
       "                \"4\\u5929\",\n",
       "                \"5\\u5929\",\n",
       "                \"6\\u5929\",\n",
       "                \"7\\u5929\",\n",
       "                \"8\\u5929\",\n",
       "                \"9\\u5929\",\n",
       "                \"10\\u5929\",\n",
       "                \"11\\u5929\",\n",
       "                \"12\\u5929\",\n",
       "                \"13\\u5929\",\n",
       "                \"14\\u5929\",\n",
       "                \"15\\u5929\",\n",
       "                \"16\\u5929\",\n",
       "                \"17\\u5929\",\n",
       "                \"18\\u5929\",\n",
       "                \"19\\u5929\",\n",
       "                \"20\\u5929\",\n",
       "                \"21\\u5929\",\n",
       "                \"22\\u5929\",\n",
       "                \"23\\u5929\",\n",
       "                \"24\\u5929\",\n",
       "                \"25\\u5929\",\n",
       "                \"26\\u5929\",\n",
       "                \"27\\u5929\",\n",
       "                \"28\\u5929\",\n",
       "                \"29\\u5929\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar-DataZoom\\uff08slider-\\u6c34\\u5e73\\uff09\"\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"type\": \"slider\",\n",
       "            \"realtime\": true,\n",
       "            \"start\": 20,\n",
       "            \"end\": 80,\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"zoomLock\": false\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_5b213d4cd8f54ade954aa891a06112bb.setOption(option_5b213d4cd8f54ade954aa891a06112bb);\n",
       "                var chart_a62be1a506684a408184677278de43aa = echarts.init(\n",
       "                    document.getElementById('a62be1a506684a408184677278de43aa'), 'white', {renderer: 'canvas'});\n",
       "                var option_a62be1a506684a408184677278de43aa = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5c0f\\u7c73\",\n",
       "                    39\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u4e09\\u661f\",\n",
       "                    125\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u534e\\u4e3a\",\n",
       "                    21\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u82f9\\u679c\",\n",
       "                    143\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9b45\\u65cf\",\n",
       "                    40\n",
       "                ],\n",
       "                [\n",
       "                    \"VIVO\",\n",
       "                    110\n",
       "                ],\n",
       "                [\n",
       "                    \"OPPO\",\n",
       "                    119\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"type\": \"min\"\n",
       "                    }\n",
       "                ]\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u5c0f\\u7c73\",\n",
       "                    47\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u4e09\\u661f\",\n",
       "                    142\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u534e\\u4e3a\",\n",
       "                    28\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u82f9\\u679c\",\n",
       "                    92\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9b45\\u65cf\",\n",
       "                    99\n",
       "                ],\n",
       "                [\n",
       "                    \"VIVO\",\n",
       "                    62\n",
       "                ],\n",
       "                [\n",
       "                    \"OPPO\",\n",
       "                    60\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"type\": \"max\"\n",
       "                    }\n",
       "                ]\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5c0f\\u7c73\",\n",
       "                \"\\u4e09\\u661f\",\n",
       "                \"\\u534e\\u4e3a\",\n",
       "                \"\\u82f9\\u679c\",\n",
       "                \"\\u9b45\\u65cf\",\n",
       "                \"VIVO\",\n",
       "                \"OPPO\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Line-MarkPoint\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_a62be1a506684a408184677278de43aa.setOption(option_a62be1a506684a408184677278de43aa);\n",
       "                var chart_01a6b65211cc42d2af788d762c63528d = echarts.init(\n",
       "                    document.getElementById('01a6b65211cc42d2af788d762c63528d'), 'white', {renderer: 'canvas'});\n",
       "                var option_01a6b65211cc42d2af788d762c63528d = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u54c8\\u58eb\\u5947\",\n",
       "                    \"value\": 119\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8428\\u6469\\u8036\",\n",
       "                    \"value\": 23\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cf0\\u8fea\",\n",
       "                    \"value\": 102\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91d1\\u6bdb\",\n",
       "                    \"value\": 122\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7267\\u7f8a\\u72ac\",\n",
       "                    \"value\": 94\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u5a03\\u5a03\",\n",
       "                    \"value\": 127\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u67ef\\u57fa\",\n",
       "                    \"value\": 64\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"30%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"25%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"radius\",\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u54c8\\u58eb\\u5947\",\n",
       "                    \"value\": 69\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8428\\u6469\\u8036\",\n",
       "                    \"value\": 110\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cf0\\u8fea\",\n",
       "                    \"value\": 25\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91d1\\u6bdb\",\n",
       "                    \"value\": 72\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u7267\\u7f8a\\u72ac\",\n",
       "                    \"value\": 126\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5409\\u5a03\\u5a03\",\n",
       "                    \"value\": 70\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u67ef\\u57fa\",\n",
       "                    \"value\": 146\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"30%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"75%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"area\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u54c8\\u58eb\\u5947\",\n",
       "                \"\\u8428\\u6469\\u8036\",\n",
       "                \"\\u6cf0\\u8fea\",\n",
       "                \"\\u91d1\\u6bdb\",\n",
       "                \"\\u7267\\u7f8a\\u72ac\",\n",
       "                \"\\u5409\\u5a03\\u5a03\",\n",
       "                \"\\u67ef\\u57fa\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Pie-\\u73ab\\u7470\\u56fe\\u793a\\u4f8b\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_01a6b65211cc42d2af788d762c63528d.setOption(option_01a6b65211cc42d2af788d762c63528d);\n",
       "        });\n",
       "    </script>\n",
       "<script>\n",
       "        (function() {\n",
       "            containers = document.getElementsByClassName(\"chart-container\");\n",
       "            if(containers.length > 0) {\n",
       "                containers[0].style.display = \"block\";\n",
       "            }\n",
       "        })()\n",
       "\n",
       "        function showChart(evt, chartID) {\n",
       "            let containers = document.getElementsByClassName(\"chart-container\");\n",
       "            for (let i = 0; i < containers.length; i++) {\n",
       "                containers[i].style.display = \"none\";\n",
       "            }\n",
       "\n",
       "            let tablinks = document.getElementsByClassName(\"tablinks\");\n",
       "            for (let i = 0; i < tablinks.length; i++) {\n",
       "                tablinks[i].className = \"tablinks\";\n",
       "            }\n",
       "\n",
       "            document.getElementById(chartID).style.display = \"block\";\n",
       "            evt.currentTarget.className += \" active\";\n",
       "        }\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11366e0af60>"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tab.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "    <style>\n",
       "        .tab {\n",
       "            overflow: hidden;\n",
       "            border: 1px solid #ccc;\n",
       "            background-color: #f1f1f1;\n",
       "        }\n",
       "\n",
       "        .tab button {\n",
       "            background-color: inherit;\n",
       "            float: left;\n",
       "            border: none;\n",
       "            outline: none;\n",
       "            cursor: pointer;\n",
       "            padding: 12px 16px;\n",
       "            transition: 0.3s;\n",
       "        }\n",
       "\n",
       "        .tab button:hover {\n",
       "            background-color: #ddd;\n",
       "        }\n",
       "\n",
       "        .tab button.active {\n",
       "            background-color: #ccc;\n",
       "        }\n",
       "\n",
       "        .chart-container {\n",
       "            display: none;\n",
       "            padding: 6px 12px;\n",
       "            border-top: none;\n",
       "        }\n",
       "    </style>\n",
       "<div class=\"tab\">\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '8fb6c326734348cfa9a167c573cd6d62')\">意尔康皮鞋旗舰店</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '09269723bb96453c95260ac93412dfe8')\">米兰多格商场</button>\n",
       "    </div>\n",
       "\n",
       "        <div id=\"8fb6c326734348cfa9a167c573cd6d62\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"09269723bb96453c95260ac93412dfe8\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_8fb6c326734348cfa9a167c573cd6d62 = echarts.init(\n",
       "                    document.getElementById('8fb6c326734348cfa9a167c573cd6d62'), 'white', {renderer: 'canvas'});\n",
       "                var option_8fb6c326734348cfa9a167c573cd6d62 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "            \"data\": [\n",
       "                3.0,\n",
       "                1.0,\n",
       "                87.0,\n",
       "                8.0,\n",
       "                38.0,\n",
       "                3.0,\n",
       "                91.0,\n",
       "                4.0,\n",
       "                7.0,\n",
       "                18.0,\n",
       "                7.0,\n",
       "                8.0,\n",
       "                9.0,\n",
       "                3.0,\n",
       "                2.0,\n",
       "                0.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_8fb6c326734348cfa9a167c573cd6d62.setOption(option_8fb6c326734348cfa9a167c573cd6d62);\n",
       "                var chart_09269723bb96453c95260ac93412dfe8 = echarts.init(\n",
       "                    document.getElementById('09269723bb96453c95260ac93412dfe8'), 'white', {renderer: 'canvas'});\n",
       "                var option_09269723bb96453c95260ac93412dfe8 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "            \"data\": [\n",
       "                1.0,\n",
       "                0.0,\n",
       "                108.0,\n",
       "                0.0,\n",
       "                9.0,\n",
       "                0.0,\n",
       "                11.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                18.0,\n",
       "                0.0,\n",
       "                8.0,\n",
       "                0.0,\n",
       "                1.0,\n",
       "                0.0,\n",
       "                2.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_09269723bb96453c95260ac93412dfe8.setOption(option_09269723bb96453c95260ac93412dfe8);\n",
       "        });\n",
       "    </script>\n",
       "<script>\n",
       "        (function() {\n",
       "            containers = document.getElementsByClassName(\"chart-container\");\n",
       "            if(containers.length > 0) {\n",
       "                containers[0].style.display = \"block\";\n",
       "            }\n",
       "        })()\n",
       "\n",
       "        function showChart(evt, chartID) {\n",
       "            let containers = document.getElementsByClassName(\"chart-container\");\n",
       "            for (let i = 0; i < containers.length; i++) {\n",
       "                containers[i].style.display = \"none\";\n",
       "            }\n",
       "\n",
       "            let tablinks = document.getElementsByClassName(\"tablinks\");\n",
       "            for (let i = 0; i < tablinks.length; i++) {\n",
       "                tablinks[i].className = \"tablinks\";\n",
       "            }\n",
       "\n",
       "            document.getElementById(chartID).style.display = \"block\";\n",
       "            evt.currentTarget.className += \" active\";\n",
       "        }\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11366bc34a8>"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f1=Bar()\n",
    "f1.add_xaxis(p0.index.tolist())\n",
    "f1.add_yaxis(\"意尔康皮鞋旗舰店\", p0[0].tolist())\n",
    "f1.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"))\n",
    "\n",
    "f2=Bar()\n",
    "f2.add_xaxis(p0.index.tolist())\n",
    "f2.add_yaxis(\"米兰多格商场\", p0[1].tolist())\n",
    "f2.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"))\n",
    "\n",
    "g1=Tab()\n",
    "g1.add(f1, \"意尔康皮鞋旗舰店\")\n",
    "g1.add(f2, \"米兰多格商场\")\n",
    "g1.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pyecharts.charts.basic_charts.bar.Bar at 0x1ee3b735ba8>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#上面grid布局后似乎要重新运行下才能在选项卡中引用\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "    <style>\n",
       "        .tab {\n",
       "            overflow: hidden;\n",
       "            border: 1px solid #ccc;\n",
       "            background-color: #f1f1f1;\n",
       "        }\n",
       "\n",
       "        .tab button {\n",
       "            background-color: inherit;\n",
       "            float: left;\n",
       "            border: none;\n",
       "            outline: none;\n",
       "            cursor: pointer;\n",
       "            padding: 12px 16px;\n",
       "            transition: 0.3s;\n",
       "        }\n",
       "\n",
       "        .tab button:hover {\n",
       "            background-color: #ddd;\n",
       "        }\n",
       "\n",
       "        .tab button.active {\n",
       "            background-color: #ccc;\n",
       "        }\n",
       "\n",
       "        .chart-container {\n",
       "            display: none;\n",
       "            padding: 6px 12px;\n",
       "            border-top: none;\n",
       "        }\n",
       "    </style>\n",
       "<div class=\"tab\">\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '5e28b25de57f4240bfff2316b3b2a86c')\">意尔康皮鞋旗舰店</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '56f51a59678247a7986d98e7be2f96fe')\">米兰多格商场</button>\n",
       "    </div>\n",
       "\n",
       "        <div id=\"5e28b25de57f4240bfff2316b3b2a86c\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"56f51a59678247a7986d98e7be2f96fe\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_5e28b25de57f4240bfff2316b3b2a86c = echarts.init(\n",
       "                    document.getElementById('5e28b25de57f4240bfff2316b3b2a86c'), 'white', {renderer: 'canvas'});\n",
       "                var option_5e28b25de57f4240bfff2316b3b2a86c = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "            \"data\": [\n",
       "                3.0,\n",
       "                1.0,\n",
       "                87.0,\n",
       "                8.0,\n",
       "                38.0,\n",
       "                3.0,\n",
       "                91.0,\n",
       "                4.0,\n",
       "                7.0,\n",
       "                18.0,\n",
       "                7.0,\n",
       "                8.0,\n",
       "                9.0,\n",
       "                3.0,\n",
       "                2.0,\n",
       "                0.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_5e28b25de57f4240bfff2316b3b2a86c.setOption(option_5e28b25de57f4240bfff2316b3b2a86c);\n",
       "                var chart_56f51a59678247a7986d98e7be2f96fe = echarts.init(\n",
       "                    document.getElementById('56f51a59678247a7986d98e7be2f96fe'), 'white', {renderer: 'canvas'});\n",
       "                var option_56f51a59678247a7986d98e7be2f96fe = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "            \"data\": [\n",
       "                1.0,\n",
       "                0.0,\n",
       "                108.0,\n",
       "                0.0,\n",
       "                9.0,\n",
       "                0.0,\n",
       "                11.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                18.0,\n",
       "                0.0,\n",
       "                8.0,\n",
       "                0.0,\n",
       "                1.0,\n",
       "                0.0,\n",
       "                2.0\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u4e50\\u798f\\u978b\",\n",
       "                \"\\u4f10\\u6728\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                \"\\u61d2\\u4eba\\u978b\",\n",
       "                \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u677f\\u978b\",\n",
       "                \"\\u6c99\\u6ee9\\u978b\",\n",
       "                \"\\u8c46\\u8c46\\u978b\",\n",
       "                \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                \"\\u5de5\\u88c5\\u978b\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_56f51a59678247a7986d98e7be2f96fe.setOption(option_56f51a59678247a7986d98e7be2f96fe);\n",
       "        });\n",
       "    </script>\n",
       "<script>\n",
       "        (function() {\n",
       "            containers = document.getElementsByClassName(\"chart-container\");\n",
       "            if(containers.length > 0) {\n",
       "                containers[0].style.display = \"block\";\n",
       "            }\n",
       "        })()\n",
       "\n",
       "        function showChart(evt, chartID) {\n",
       "            let containers = document.getElementsByClassName(\"chart-container\");\n",
       "            for (let i = 0; i < containers.length; i++) {\n",
       "                containers[i].style.display = \"none\";\n",
       "            }\n",
       "\n",
       "            let tablinks = document.getElementsByClassName(\"tablinks\");\n",
       "            for (let i = 0; i < tablinks.length; i++) {\n",
       "                tablinks[i].className = \"tablinks\";\n",
       "            }\n",
       "\n",
       "            document.getElementById(chartID).style.display = \"block\";\n",
       "            evt.currentTarget.className += \" active\";\n",
       "        }\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ee3927c748>"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Bar, Tab, Pie, Line\n",
    "\n",
    "f1=Bar()\n",
    "f1.add_xaxis(p0.index.tolist())\n",
    "f1.add_yaxis(\"意尔康皮鞋旗舰店\", p0[0].tolist())\n",
    "f1.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"))\n",
    "\n",
    "f2=Bar()\n",
    "f2.add_xaxis(p0.index.tolist())\n",
    "f2.add_yaxis(\"米兰多格商场\", p0[1].tolist())\n",
    "f2.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"))\n",
    "\n",
    "tab = Tab()\n",
    "tab.add(f1, \"意尔康皮鞋旗舰店\")\n",
    "tab.add(f2, \"米兰多格商场\")\n",
    "tab.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 时间线轮播\n",
    "\n",
    "* 参考官网案例做出时间轮播图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.charts import Bar, Page, Pie, Timeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"710dba4a20c24970862d06525d9c9cae\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_710dba4a20c24970862d06525d9c9cae = echarts.init(\n",
       "                    document.getElementById('710dba4a20c24970862d06525d9c9cae'), 'white', {renderer: 'canvas'});\n",
       "                var option_710dba4a20c24970862d06525d9c9cae = {\n",
       "    \"baseOption\": {\n",
       "        \"series\": [\n",
       "            {\n",
       "                \"type\": \"bar\",\n",
       "                \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "                \"data\": [\n",
       "                    1.0,\n",
       "                    0.0,\n",
       "                    108.0,\n",
       "                    0.0,\n",
       "                    9.0,\n",
       "                    0.0,\n",
       "                    11.0,\n",
       "                    0.0,\n",
       "                    0.0,\n",
       "                    18.0,\n",
       "                    0.0,\n",
       "                    8.0,\n",
       "                    0.0,\n",
       "                    1.0,\n",
       "                    0.0,\n",
       "                    2.0\n",
       "                ],\n",
       "                \"barCategoryGap\": \"20%\",\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        ],\n",
       "        \"timeline\": {\n",
       "            \"axisType\": \"category\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"autoPlay\": false,\n",
       "            \"loop\": true,\n",
       "            \"rewind\": false,\n",
       "            \"show\": true,\n",
       "            \"inverse\": false,\n",
       "            \"bottom\": \"-5px\",\n",
       "            \"data\": [\n",
       "                \"777\",\n",
       "                \"888\"\n",
       "            ]\n",
       "        },\n",
       "        \"xAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                },\n",
       "                \"data\": [\n",
       "                    \"\\u4e50\\u798f\\u978b\",\n",
       "                    \"\\u4f10\\u6728\\u978b\",\n",
       "                    \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                    \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                    \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                    \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                    \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                    \"\\u61d2\\u4eba\\u978b\",\n",
       "                    \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                    \"\\u677f\\u978b\",\n",
       "                    \"\\u6c99\\u6ee9\\u978b\",\n",
       "                    \"\\u8c46\\u8c46\\u978b\",\n",
       "                    \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                    \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                    \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                    \"\\u5de5\\u88c5\\u978b\"\n",
       "                ]\n",
       "            }\n",
       "        ],\n",
       "        \"yAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    \"options\": [\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true\n",
       "                    },\n",
       "                    \"show\": true\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        3.0,\n",
       "                        1.0,\n",
       "                        87.0,\n",
       "                        8.0,\n",
       "                        38.0,\n",
       "                        3.0,\n",
       "                        91.0,\n",
       "                        4.0,\n",
       "                        7.0,\n",
       "                        18.0,\n",
       "                        7.0,\n",
       "                        8.0,\n",
       "                        9.0,\n",
       "                        3.0,\n",
       "                        2.0,\n",
       "                        0.0\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u4e50\\u798f\\u978b\",\n",
       "                        \"\\u4f10\\u6728\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                        \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                        \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                        \"\\u61d2\\u4eba\\u978b\",\n",
       "                        \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u677f\\u978b\",\n",
       "                        \"\\u6c99\\u6ee9\\u978b\",\n",
       "                        \"\\u8c46\\u8c46\\u978b\",\n",
       "                        \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                        \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                        \"\\u5de5\\u88c5\\u978b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "                    \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "                    },\n",
       "                    \"show\": true\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        1.0,\n",
       "                        0.0,\n",
       "                        108.0,\n",
       "                        0.0,\n",
       "                        9.0,\n",
       "                        0.0,\n",
       "                        11.0,\n",
       "                        0.0,\n",
       "                        0.0,\n",
       "                        18.0,\n",
       "                        0.0,\n",
       "                        8.0,\n",
       "                        0.0,\n",
       "                        1.0,\n",
       "                        0.0,\n",
       "                        2.0\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u4e50\\u798f\\u978b\",\n",
       "                        \"\\u4f10\\u6728\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                        \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                        \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                        \"\\u61d2\\u4eba\\u978b\",\n",
       "                        \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u677f\\u978b\",\n",
       "                        \"\\u6c99\\u6ee9\\u978b\",\n",
       "                        \"\\u8c46\\u8c46\\u978b\",\n",
       "                        \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                        \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                        \"\\u5de5\\u88c5\\u978b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "                    \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_710dba4a20c24970862d06525d9c9cae.setOption(option_710dba4a20c24970862d06525d9c9cae);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11366e141d0>"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f1=Bar()\n",
    "f1.add_xaxis(p0.index.tolist())\n",
    "f1.add_yaxis(\"意尔康皮鞋旗舰店\", p0[0].tolist())\n",
    "f1.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"))\n",
    "\n",
    "f2=Bar()\n",
    "f2.add_xaxis(p0.index.tolist())\n",
    "f2.add_yaxis(\"米兰多格商场\", p0[1].tolist())\n",
    "f2.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"))\n",
    "\n",
    "t1=Timeline()\n",
    "t1.add(f1,\"777\")\n",
    "t1.add(f2,\"888\")\n",
    "t1.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"7cb9668da283470cb1cc6b4426e666b4\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_7cb9668da283470cb1cc6b4426e666b4 = echarts.init(\n",
       "                    document.getElementById('7cb9668da283470cb1cc6b4426e666b4'), 'white', {renderer: 'canvas'});\n",
       "                var option_7cb9668da283470cb1cc6b4426e666b4 = {\n",
       "    \"baseOption\": {\n",
       "        \"series\": [\n",
       "            {\n",
       "                \"type\": \"bar\",\n",
       "                \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "                \"data\": [\n",
       "                    1.0,\n",
       "                    0.0,\n",
       "                    108.0,\n",
       "                    0.0,\n",
       "                    9.0,\n",
       "                    0.0,\n",
       "                    11.0,\n",
       "                    0.0,\n",
       "                    0.0,\n",
       "                    18.0,\n",
       "                    0.0,\n",
       "                    8.0,\n",
       "                    0.0,\n",
       "                    1.0,\n",
       "                    0.0,\n",
       "                    2.0\n",
       "                ],\n",
       "                \"barCategoryGap\": \"20%\",\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        ],\n",
       "        \"timeline\": {\n",
       "            \"axisType\": \"category\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"autoPlay\": false,\n",
       "            \"loop\": true,\n",
       "            \"rewind\": false,\n",
       "            \"show\": true,\n",
       "            \"inverse\": false,\n",
       "            \"bottom\": \"-5px\",\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "            ]\n",
       "        },\n",
       "        \"xAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                },\n",
       "                \"data\": [\n",
       "                    \"\\u4e50\\u798f\\u978b\",\n",
       "                    \"\\u4f10\\u6728\\u978b\",\n",
       "                    \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                    \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                    \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                    \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                    \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                    \"\\u61d2\\u4eba\\u978b\",\n",
       "                    \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                    \"\\u677f\\u978b\",\n",
       "                    \"\\u6c99\\u6ee9\\u978b\",\n",
       "                    \"\\u8c46\\u8c46\\u978b\",\n",
       "                    \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                    \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                    \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                    \"\\u5de5\\u88c5\\u978b\"\n",
       "                ]\n",
       "            }\n",
       "        ],\n",
       "        \"yAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    \"options\": [\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true\n",
       "                    },\n",
       "                    \"show\": true\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        3.0,\n",
       "                        1.0,\n",
       "                        87.0,\n",
       "                        8.0,\n",
       "                        38.0,\n",
       "                        3.0,\n",
       "                        91.0,\n",
       "                        4.0,\n",
       "                        7.0,\n",
       "                        18.0,\n",
       "                        7.0,\n",
       "                        8.0,\n",
       "                        9.0,\n",
       "                        3.0,\n",
       "                        2.0,\n",
       "                        0.0\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u4e50\\u798f\\u978b\",\n",
       "                        \"\\u4f10\\u6728\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                        \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                        \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                        \"\\u61d2\\u4eba\\u978b\",\n",
       "                        \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u677f\\u978b\",\n",
       "                        \"\\u6c99\\u6ee9\\u978b\",\n",
       "                        \"\\u8c46\\u8c46\\u978b\",\n",
       "                        \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                        \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                        \"\\u5de5\\u88c5\\u978b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "                    \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "                    },\n",
       "                    \"show\": true\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        1.0,\n",
       "                        0.0,\n",
       "                        108.0,\n",
       "                        0.0,\n",
       "                        9.0,\n",
       "                        0.0,\n",
       "                        11.0,\n",
       "                        0.0,\n",
       "                        0.0,\n",
       "                        18.0,\n",
       "                        0.0,\n",
       "                        8.0,\n",
       "                        0.0,\n",
       "                        1.0,\n",
       "                        0.0,\n",
       "                        2.0\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u4e50\\u798f\\u978b\",\n",
       "                        \"\\u4f10\\u6728\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                        \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                        \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                        \"\\u61d2\\u4eba\\u978b\",\n",
       "                        \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u677f\\u978b\",\n",
       "                        \"\\u6c99\\u6ee9\\u978b\",\n",
       "                        \"\\u8c46\\u8c46\\u978b\",\n",
       "                        \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                        \"\\u9ad8\\u5e2e\\u677f\\u978b\",\n",
       "                        \"\\u5de5\\u88c5\\u978b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Bar-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "                    \"subtext\": \"\\u6211\\u662f\\u526f\\u6807\\u9898\"\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_7cb9668da283470cb1cc6b4426e666b4.setOption(option_7cb9668da283470cb1cc6b4426e666b4);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11366de2e48>"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f1=Bar()\n",
    "f1.add_xaxis(p0.index.tolist())\n",
    "f1.add_yaxis(\"意尔康皮鞋旗舰店\", p0[0].tolist())\n",
    "f1.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"))\n",
    "\n",
    "f2=Bar()\n",
    "f2.add_xaxis(p0.index.tolist())\n",
    "f2.add_yaxis(\"米兰多格商场\", p0[1].tolist())\n",
    "f2.set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-基本示例\", subtitle=\"我是副标题\"))\n",
    "\n",
    "tl = Timeline()\n",
    "tl.add(f1, \"意尔康皮鞋旗舰店\")\n",
    "tl.add(f2, \"米兰多格商场\")\n",
    "tl.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Page, Pie, Timeline\n",
    "\n",
    "\n",
    "def timeline_bar() -> Timeline:\n",
    "    x = Faker.choose()\n",
    "    tl = Timeline()\n",
    "    for i in range(2015, 2020):\n",
    "        bar = (\n",
    "            Bar()\n",
    "            .add_xaxis(x)\n",
    "            .add_yaxis(\"商家A\", Faker.values())\n",
    "            .add_yaxis(\"商家B\", Faker.values())\n",
    "            .set_global_opts(title_opts=opts.TitleOpts(\"某商店{}年营业额\".format(i)))\n",
    "        )\n",
    "        tl.add(bar, \"{}年\".format(i))\n",
    "    return tl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"6e4aa966e22e4bcfaf8ba5d88a59bd8a\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_6e4aa966e22e4bcfaf8ba5d88a59bd8a = echarts.init(\n",
       "                    document.getElementById('6e4aa966e22e4bcfaf8ba5d88a59bd8a'), 'white', {renderer: 'canvas'});\n",
       "                var option_6e4aa966e22e4bcfaf8ba5d88a59bd8a = {\n",
       "    \"baseOption\": {\n",
       "        \"series\": [\n",
       "            {\n",
       "                \"type\": \"bar\",\n",
       "                \"name\": \"\\u5546\\u5bb6A\",\n",
       "                \"data\": [\n",
       "                    101,\n",
       "                    112,\n",
       "                    145,\n",
       "                    113,\n",
       "                    74,\n",
       "                    105,\n",
       "                    118\n",
       "                ],\n",
       "                \"barCategoryGap\": \"20%\",\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            {\n",
       "                \"type\": \"bar\",\n",
       "                \"name\": \"\\u5546\\u5bb6B\",\n",
       "                \"data\": [\n",
       "                    109,\n",
       "                    133,\n",
       "                    20,\n",
       "                    48,\n",
       "                    142,\n",
       "                    138,\n",
       "                    24\n",
       "                ],\n",
       "                \"barCategoryGap\": \"20%\",\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        ],\n",
       "        \"timeline\": {\n",
       "            \"axisType\": \"category\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"autoPlay\": false,\n",
       "            \"loop\": true,\n",
       "            \"rewind\": false,\n",
       "            \"show\": true,\n",
       "            \"inverse\": false,\n",
       "            \"bottom\": \"-5px\",\n",
       "            \"data\": [\n",
       "                \"2015\\u5e74\",\n",
       "                \"2016\\u5e74\",\n",
       "                \"2017\\u5e74\",\n",
       "                \"2018\\u5e74\",\n",
       "                \"2019\\u5e74\"\n",
       "            ]\n",
       "        },\n",
       "        \"xAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                },\n",
       "                \"data\": [\n",
       "                    \"\\u53ef\\u4e50\",\n",
       "                    \"\\u96ea\\u78a7\",\n",
       "                    \"\\u6a59\\u6c41\",\n",
       "                    \"\\u7eff\\u8336\",\n",
       "                    \"\\u5976\\u8336\",\n",
       "                    \"\\u767e\\u5a01\",\n",
       "                    \"\\u9752\\u5c9b\"\n",
       "                ]\n",
       "            }\n",
       "        ],\n",
       "        \"yAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    \"options\": [\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5546\\u5bb6A\",\n",
       "                        \"\\u5546\\u5bb6B\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5546\\u5bb6A\": true,\n",
       "                        \"\\u5546\\u5bb6B\": true\n",
       "                    },\n",
       "                    \"show\": true\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        34,\n",
       "                        31,\n",
       "                        87,\n",
       "                        43,\n",
       "                        96,\n",
       "                        121,\n",
       "                        107\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        97,\n",
       "                        97,\n",
       "                        92,\n",
       "                        97,\n",
       "                        53,\n",
       "                        135,\n",
       "                        110\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u53ef\\u4e50\",\n",
       "                        \"\\u96ea\\u78a7\",\n",
       "                        \"\\u6a59\\u6c41\",\n",
       "                        \"\\u7eff\\u8336\",\n",
       "                        \"\\u5976\\u8336\",\n",
       "                        \"\\u767e\\u5a01\",\n",
       "                        \"\\u9752\\u5c9b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"\\u67d0\\u5546\\u5e972015\\u5e74\\u8425\\u4e1a\\u989d\"\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5546\\u5bb6A\",\n",
       "                        \"\\u5546\\u5bb6B\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5546\\u5bb6A\": true,\n",
       "                        \"\\u5546\\u5bb6B\": true\n",
       "                    },\n",
       "                    \"show\": true\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        141,\n",
       "                        32,\n",
       "                        113,\n",
       "                        64,\n",
       "                        143,\n",
       "                        135,\n",
       "                        34\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        44,\n",
       "                        149,\n",
       "                        85,\n",
       "                        131,\n",
       "                        105,\n",
       "                        112,\n",
       "                        137\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u53ef\\u4e50\",\n",
       "                        \"\\u96ea\\u78a7\",\n",
       "                        \"\\u6a59\\u6c41\",\n",
       "                        \"\\u7eff\\u8336\",\n",
       "                        \"\\u5976\\u8336\",\n",
       "                        \"\\u767e\\u5a01\",\n",
       "                        \"\\u9752\\u5c9b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"\\u67d0\\u5546\\u5e972016\\u5e74\\u8425\\u4e1a\\u989d\"\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5546\\u5bb6A\",\n",
       "                        \"\\u5546\\u5bb6B\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5546\\u5bb6A\": true,\n",
       "                        \"\\u5546\\u5bb6B\": true\n",
       "                    },\n",
       "                    \"show\": true\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        134,\n",
       "                        57,\n",
       "                        147,\n",
       "                        58,\n",
       "                        136,\n",
       "                        45,\n",
       "                        90\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        109,\n",
       "                        134,\n",
       "                        69,\n",
       "                        109,\n",
       "                        34,\n",
       "                        83,\n",
       "                        39\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u53ef\\u4e50\",\n",
       "                        \"\\u96ea\\u78a7\",\n",
       "                        \"\\u6a59\\u6c41\",\n",
       "                        \"\\u7eff\\u8336\",\n",
       "                        \"\\u5976\\u8336\",\n",
       "                        \"\\u767e\\u5a01\",\n",
       "                        \"\\u9752\\u5c9b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"\\u67d0\\u5546\\u5e972017\\u5e74\\u8425\\u4e1a\\u989d\"\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5546\\u5bb6A\",\n",
       "                        \"\\u5546\\u5bb6B\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5546\\u5bb6A\": true,\n",
       "                        \"\\u5546\\u5bb6B\": true\n",
       "                    },\n",
       "                    \"show\": true\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        111,\n",
       "                        61,\n",
       "                        99,\n",
       "                        118,\n",
       "                        89,\n",
       "                        26,\n",
       "                        55\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        92,\n",
       "                        59,\n",
       "                        31,\n",
       "                        46,\n",
       "                        28,\n",
       "                        75,\n",
       "                        24\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u53ef\\u4e50\",\n",
       "                        \"\\u96ea\\u78a7\",\n",
       "                        \"\\u6a59\\u6c41\",\n",
       "                        \"\\u7eff\\u8336\",\n",
       "                        \"\\u5976\\u8336\",\n",
       "                        \"\\u767e\\u5a01\",\n",
       "                        \"\\u9752\\u5c9b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"\\u67d0\\u5546\\u5e972018\\u5e74\\u8425\\u4e1a\\u989d\"\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5546\\u5bb6A\",\n",
       "                        \"\\u5546\\u5bb6B\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5546\\u5bb6A\": true,\n",
       "                        \"\\u5546\\u5bb6B\": true\n",
       "                    },\n",
       "                    \"show\": true\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        101,\n",
       "                        112,\n",
       "                        145,\n",
       "                        113,\n",
       "                        74,\n",
       "                        105,\n",
       "                        118\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        109,\n",
       "                        133,\n",
       "                        20,\n",
       "                        48,\n",
       "                        142,\n",
       "                        138,\n",
       "                        24\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u53ef\\u4e50\",\n",
       "                        \"\\u96ea\\u78a7\",\n",
       "                        \"\\u6a59\\u6c41\",\n",
       "                        \"\\u7eff\\u8336\",\n",
       "                        \"\\u5976\\u8336\",\n",
       "                        \"\\u767e\\u5a01\",\n",
       "                        \"\\u9752\\u5c9b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"\\u67d0\\u5546\\u5e972019\\u5e74\\u8425\\u4e1a\\u989d\"\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_6e4aa966e22e4bcfaf8ba5d88a59bd8a.setOption(option_6e4aa966e22e4bcfaf8ba5d88a59bd8a);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ee3c8b4080>"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "timeline_bar().render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"257e53a4ac0443378443463fe2cdc9e6\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_257e53a4ac0443378443463fe2cdc9e6 = echarts.init(\n",
       "                    document.getElementById('257e53a4ac0443378443463fe2cdc9e6'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_257e53a4ac0443378443463fe2cdc9e6 = {\n",
       "    \"baseOption\": {\n",
       "        \"series\": [\n",
       "            {\n",
       "                \"type\": \"bar\",\n",
       "                \"name\": \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\",\n",
       "                \"data\": [\n",
       "                    1.0,\n",
       "                    0.0,\n",
       "                    108.0,\n",
       "                    0.0,\n",
       "                    9.0,\n",
       "                    2.0,\n",
       "                    0.0,\n",
       "                    11.0,\n",
       "                    0.0,\n",
       "                    0.0,\n",
       "                    18.0,\n",
       "                    0.0,\n",
       "                    8.0,\n",
       "                    0.0,\n",
       "                    1.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                \"barCategoryGap\": \"20%\",\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        ],\n",
       "        \"timeline\": {\n",
       "            \"axisType\": \"category\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"autoPlay\": false,\n",
       "            \"loop\": true,\n",
       "            \"rewind\": false,\n",
       "            \"show\": true,\n",
       "            \"inverse\": false,\n",
       "            \"bottom\": \"-5px\",\n",
       "            \"data\": [\n",
       "                \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\",\n",
       "                \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "            ]\n",
       "        },\n",
       "        \"xAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                },\n",
       "                \"data\": [\n",
       "                    \"\\u4e50\\u798f\\u978b\",\n",
       "                    \"\\u4f10\\u6728\\u978b\",\n",
       "                    \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                    \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                    \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                    \"\\u5de5\\u88c5\\u978b\",\n",
       "                    \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                    \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                    \"\\u61d2\\u4eba\\u978b\",\n",
       "                    \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                    \"\\u677f\\u978b\",\n",
       "                    \"\\u6c99\\u6ee9\\u978b\",\n",
       "                    \"\\u8c46\\u8c46\\u978b\",\n",
       "                    \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                    \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                    \"\\u9ad8\\u5e2e\\u677f\\u978b\"\n",
       "                ]\n",
       "            }\n",
       "        ],\n",
       "        \"yAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    \"options\": [\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u610f\\u5c14\\u5eb7\\u76ae\\u978b\\u65d7\\u8230\\u5e97\": true\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        3.0,\n",
       "                        1.0,\n",
       "                        87.0,\n",
       "                        8.0,\n",
       "                        38.0,\n",
       "                        0.0,\n",
       "                        3.0,\n",
       "                        91.0,\n",
       "                        4.0,\n",
       "                        7.0,\n",
       "                        18.0,\n",
       "                        7.0,\n",
       "                        8.0,\n",
       "                        9.0,\n",
       "                        3.0,\n",
       "                        2.0\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u4e50\\u798f\\u978b\",\n",
       "                        \"\\u4f10\\u6728\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                        \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u5de5\\u88c5\\u978b\",\n",
       "                        \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                        \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                        \"\\u61d2\\u4eba\\u978b\",\n",
       "                        \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u677f\\u978b\",\n",
       "                        \"\\u6c99\\u6ee9\\u978b\",\n",
       "                        \"\\u8c46\\u8c46\\u978b\",\n",
       "                        \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                        \"\\u9ad8\\u5e2e\\u677f\\u978b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u7c73\\u5170\\u591a\\u683c\\u5546\\u573a\": true\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        1.0,\n",
       "                        0.0,\n",
       "                        108.0,\n",
       "                        0.0,\n",
       "                        9.0,\n",
       "                        2.0,\n",
       "                        0.0,\n",
       "                        11.0,\n",
       "                        0.0,\n",
       "                        0.0,\n",
       "                        18.0,\n",
       "                        0.0,\n",
       "                        8.0,\n",
       "                        0.0,\n",
       "                        1.0,\n",
       "                        0.0\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"\\u4e50\\u798f\\u978b\",\n",
       "                        \"\\u4f10\\u6728\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u76ae\\u978b\",\n",
       "                        \"\\u4f11\\u95f2\\u9ad8\\u5e2e\\u76ae\\u978b\",\n",
       "                        \"\\u5546\\u52a1\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u5de5\\u88c5\\u978b\",\n",
       "                        \"\\u5e03\\u6d1b\\u514b\\u978b\",\n",
       "                        \"\\u5fb7\\u6bd4\\u978b\\uff08\\u6b63\\u88c5\\u76ae\\u978b\\uff09\",\n",
       "                        \"\\u61d2\\u4eba\\u978b\",\n",
       "                        \"\\u6237\\u5916\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u677f\\u978b\",\n",
       "                        \"\\u6c99\\u6ee9\\u978b\",\n",
       "                        \"\\u8c46\\u8c46\\u978b\",\n",
       "                        \"\\u8fd0\\u52a8\\u4f11\\u95f2\\u978b\",\n",
       "                        \"\\u9542\\u7a7a\\u76ae\\u978b\",\n",
       "                        \"\\u9ad8\\u5e2e\\u677f\\u978b\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_257e53a4ac0443378443463fe2cdc9e6.setOption(option_257e53a4ac0443378443463fe2cdc9e6);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ee3b74b7f0>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3d柱状图与热图\n",
    "\n",
    "* 对于多维数据，3d图是非常形象的表现方法，x,y轴通常表示两个条件限定，z轴（柱的高度）通常表示在这样限定下的数量\n",
    "\n",
    "* 注意pyecharts3d柱状图的数据格式，x,y分别对应有哪些类别，通常是一个列表，而data是一个三元列表，前两个为确定哪两个类别，通过序号指代，最后一个为数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar3D\n",
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "#官网上的例子\n",
    "def bar3d_base() -> Bar3D:\n",
    "    data = [(i, j, random.randint(0, 12)) for i in range(6) for j in range(24)]\n",
    "    c = (\n",
    "        Bar3D()\n",
    "        .add(\n",
    "            \"\",\n",
    "            [[d[1], d[0], d[2]] for d in data],\n",
    "            xaxis3d_opts=opts.Axis3DOpts(Faker.clock, type_=\"category\"),\n",
    "            yaxis3d_opts=opts.Axis3DOpts(Faker.week_en, type_=\"category\"),\n",
    "            zaxis3d_opts=opts.Axis3DOpts(type_=\"value\"),\n",
    "        )\n",
    "        .set_global_opts(\n",
    "            visualmap_opts=opts.VisualMapOpts(max_=20),\n",
    "            title_opts=opts.TitleOpts(title=\"Bar3D-基本示例\"),\n",
    "        )\n",
    "    )\n",
    "    return c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['12a',\n",
       " '1a',\n",
       " '2a',\n",
       " '3a',\n",
       " '4a',\n",
       " '5a',\n",
       " '6a',\n",
       " '7a',\n",
       " '8a',\n",
       " '9a',\n",
       " '10a',\n",
       " '11a',\n",
       " '12p',\n",
       " '1p',\n",
       " '2p',\n",
       " '3p',\n",
       " '4p',\n",
       " '5p',\n",
       " '6p',\n",
       " '7p',\n",
       " '8p',\n",
       " '9p',\n",
       " '10p',\n",
       " '11p']"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Faker.clock"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(0, 0, 1),\n",
       " (0, 1, 1),\n",
       " (0, 2, 1),\n",
       " (0, 3, 4),\n",
       " (0, 4, 4),\n",
       " (0, 5, 4),\n",
       " (0, 6, 5),\n",
       " (0, 7, 9),\n",
       " (0, 8, 11),\n",
       " (0, 9, 7),\n",
       " (0, 10, 6),\n",
       " (0, 11, 2),\n",
       " (0, 12, 1),\n",
       " (0, 13, 6),\n",
       " (0, 14, 10),\n",
       " (0, 15, 12),\n",
       " (0, 16, 8),\n",
       " (0, 17, 1),\n",
       " (0, 18, 0),\n",
       " (0, 19, 11),\n",
       " (0, 20, 9),\n",
       " (0, 21, 11),\n",
       " (0, 22, 11),\n",
       " (0, 23, 11),\n",
       " (1, 0, 10),\n",
       " (1, 1, 7),\n",
       " (1, 2, 10),\n",
       " (1, 3, 0),\n",
       " (1, 4, 8),\n",
       " (1, 5, 8),\n",
       " (1, 6, 0),\n",
       " (1, 7, 4),\n",
       " (1, 8, 2),\n",
       " (1, 9, 1),\n",
       " (1, 10, 4),\n",
       " (1, 11, 0),\n",
       " (1, 12, 7),\n",
       " (1, 13, 10),\n",
       " (1, 14, 6),\n",
       " (1, 15, 1),\n",
       " (1, 16, 12),\n",
       " (1, 17, 6),\n",
       " (1, 18, 1),\n",
       " (1, 19, 3),\n",
       " (1, 20, 10),\n",
       " (1, 21, 12),\n",
       " (1, 22, 11),\n",
       " (1, 23, 0),\n",
       " (2, 0, 12),\n",
       " (2, 1, 8),\n",
       " (2, 2, 9),\n",
       " (2, 3, 9),\n",
       " (2, 4, 5),\n",
       " (2, 5, 2),\n",
       " (2, 6, 2),\n",
       " (2, 7, 5),\n",
       " (2, 8, 11),\n",
       " (2, 9, 2),\n",
       " (2, 10, 4),\n",
       " (2, 11, 0),\n",
       " (2, 12, 12),\n",
       " (2, 13, 6),\n",
       " (2, 14, 0),\n",
       " (2, 15, 1),\n",
       " (2, 16, 10),\n",
       " (2, 17, 1),\n",
       " (2, 18, 0),\n",
       " (2, 19, 7),\n",
       " (2, 20, 5),\n",
       " (2, 21, 3),\n",
       " (2, 22, 10),\n",
       " (2, 23, 12),\n",
       " (3, 0, 8),\n",
       " (3, 1, 7),\n",
       " (3, 2, 6),\n",
       " (3, 3, 12),\n",
       " (3, 4, 11),\n",
       " (3, 5, 3),\n",
       " (3, 6, 0),\n",
       " (3, 7, 11),\n",
       " (3, 8, 9),\n",
       " (3, 9, 7),\n",
       " (3, 10, 5),\n",
       " (3, 11, 7),\n",
       " (3, 12, 8),\n",
       " (3, 13, 5),\n",
       " (3, 14, 6),\n",
       " (3, 15, 10),\n",
       " (3, 16, 9),\n",
       " (3, 17, 8),\n",
       " (3, 18, 2),\n",
       " (3, 19, 8),\n",
       " (3, 20, 2),\n",
       " (3, 21, 1),\n",
       " (3, 22, 6),\n",
       " (3, 23, 12),\n",
       " (4, 0, 3),\n",
       " (4, 1, 0),\n",
       " (4, 2, 11),\n",
       " (4, 3, 6),\n",
       " (4, 4, 8),\n",
       " (4, 5, 11),\n",
       " (4, 6, 6),\n",
       " (4, 7, 1),\n",
       " (4, 8, 1),\n",
       " (4, 9, 4),\n",
       " (4, 10, 9),\n",
       " (4, 11, 7),\n",
       " (4, 12, 5),\n",
       " (4, 13, 6),\n",
       " (4, 14, 6),\n",
       " (4, 15, 12),\n",
       " (4, 16, 1),\n",
       " (4, 17, 3),\n",
       " (4, 18, 5),\n",
       " (4, 19, 12),\n",
       " (4, 20, 5),\n",
       " (4, 21, 5),\n",
       " (4, 22, 11),\n",
       " (4, 23, 6),\n",
       " (5, 0, 5),\n",
       " (5, 1, 1),\n",
       " (5, 2, 7),\n",
       " (5, 3, 3),\n",
       " (5, 4, 12),\n",
       " (5, 5, 6),\n",
       " (5, 6, 12),\n",
       " (5, 7, 4),\n",
       " (5, 8, 7),\n",
       " (5, 9, 0),\n",
       " (5, 10, 10),\n",
       " (5, 11, 5),\n",
       " (5, 12, 10),\n",
       " (5, 13, 9),\n",
       " (5, 14, 9),\n",
       " (5, 15, 5),\n",
       " (5, 16, 10),\n",
       " (5, 17, 6),\n",
       " (5, 18, 4),\n",
       " (5, 19, 7),\n",
       " (5, 20, 12),\n",
       " (5, 21, 9),\n",
       " (5, 22, 5),\n",
       " (5, 23, 6)]"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[(i, j, random.randint(0, 12)) for i in range(6) for j in range(24)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'echarts-gl':'https://assets.pyecharts.org/assets/echarts-gl.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"fb5e99f9b13040d2adfc3d5e56655559\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'echarts-gl'], function(echarts) {\n",
       "                var chart_fb5e99f9b13040d2adfc3d5e56655559 = echarts.init(\n",
       "                    document.getElementById('fb5e99f9b13040d2adfc3d5e56655559'), 'white', {renderer: 'canvas'});\n",
       "                var option_fb5e99f9b13040d2adfc3d5e56655559 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar3D\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    0,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    0,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    0,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    0,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    0,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    0,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    0,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    0,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    0,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    0,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    0,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    0,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    0,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    0,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    0,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    0,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    0,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    0,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    0,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    0,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    1,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    1,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    1,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    1,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    1,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    1,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    1,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    1,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    1,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    1,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    1,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    1,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    1,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    1,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    1,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    1,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    1,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    1,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    1,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    1,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    1,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    1,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    1,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    1,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    2,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    2,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    2,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    2,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    2,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    2,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    2,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    2,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    2,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    2,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    2,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    2,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    2,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    2,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    2,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    2,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    2,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    2,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    2,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    2,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    2,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    2,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    2,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    2,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    3,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    3,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    3,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    3,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    3,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    3,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    3,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    3,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    3,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    3,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    3,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    3,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    3,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    3,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    3,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    3,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    3,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    3,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    3,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    3,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    3,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    3,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    3,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    3,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    4,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    4,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    4,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    4,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    4,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    4,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    4,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    4,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    4,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    4,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    4,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    4,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    4,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    4,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    4,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    4,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    4,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    4,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    4,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    4,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    4,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    4,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    4,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    4,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    5,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    5,\n",
       "                    0\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    5,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    5,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    5,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    5,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    5,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    5,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    5,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    5,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    5,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    5,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    5,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    5,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    5,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    5,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    5,\n",
       "                    9\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    5,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    20,\n",
       "                    5,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    21,\n",
       "                    5,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    22,\n",
       "                    5,\n",
       "                    7\n",
       "                ],\n",
       "                [\n",
       "                    23,\n",
       "                    5,\n",
       "                    9\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 20,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true\n",
       "    },\n",
       "    \"xAxis3D\": {\n",
       "        \"data\": [\n",
       "            \"12a\",\n",
       "            \"1a\",\n",
       "            \"2a\",\n",
       "            \"3a\",\n",
       "            \"4a\",\n",
       "            \"5a\",\n",
       "            \"6a\",\n",
       "            \"7a\",\n",
       "            \"8a\",\n",
       "            \"9a\",\n",
       "            \"10a\",\n",
       "            \"11a\",\n",
       "            \"12p\",\n",
       "            \"1p\",\n",
       "            \"2p\",\n",
       "            \"3p\",\n",
       "            \"4p\",\n",
       "            \"5p\",\n",
       "            \"6p\",\n",
       "            \"7p\",\n",
       "            \"8p\",\n",
       "            \"9p\",\n",
       "            \"10p\",\n",
       "            \"11p\"\n",
       "        ],\n",
       "        \"nameGap\": 20,\n",
       "        \"type\": \"category\",\n",
       "        \"axisLabel\": {\n",
       "            \"margin\": 8\n",
       "        }\n",
       "    },\n",
       "    \"yAxis3D\": {\n",
       "        \"data\": [\n",
       "            \"Saturday\",\n",
       "            \"Friday\",\n",
       "            \"Thursday\",\n",
       "            \"Wednesday\",\n",
       "            \"Tuesday\",\n",
       "            \"Monday\",\n",
       "            \"Sunday\"\n",
       "        ],\n",
       "        \"nameGap\": 20,\n",
       "        \"type\": \"category\",\n",
       "        \"axisLabel\": {\n",
       "            \"margin\": 8\n",
       "        }\n",
       "    },\n",
       "    \"zAxis3D\": {\n",
       "        \"nameGap\": 20,\n",
       "        \"type\": \"value\",\n",
       "        \"axisLabel\": {\n",
       "            \"margin\": 8\n",
       "        }\n",
       "    },\n",
       "    \"grid3D\": {\n",
       "        \"boxWidth\": 200,\n",
       "        \"boxHeight\": 100,\n",
       "        \"boxDepth\": 80,\n",
       "        \"viewControl\": {\n",
       "            \"autoRotate\": false,\n",
       "            \"autoRotateSpeed\": 10,\n",
       "            \"rotateSensitivity\": 1\n",
       "        }\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar3D-\\u57fa\\u672c\\u793a\\u4f8b\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_fb5e99f9b13040d2adfc3d5e56655559.setOption(option_fb5e99f9b13040d2adfc3d5e56655559);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1ee3cae90f0>"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bar3d_base().render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 求出\"info.鞋面材质\",\"info.风格\"这两个特征下商品的数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "p0=a.groupby([\"info.鞋面材质\",\"info.风格\"]).size().sort_values(ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['头层牛皮（除牛反绒）', 'PU', '二层牛皮（除牛反绒）', '人造革', '超纤', '牛反绒', '磨砂皮', '绒面', '多种材质拼接', '太空革', '布', '二层猪皮', '鳄鱼皮', '网布', '头层猪皮', '羊皮毛一体', '棉布', '塑胶', '超纤皮', '牛仔布']\n",
      "['商务', '休闲', '青春潮流', '简约', '英伦', '韩版', '运动', '欧美', '复古', '民族风']\n"
     ]
    }
   ],
   "source": [
    "x=[]\n",
    "y=[]\n",
    "for i in p0.items():\n",
    "    if i[0][0] not in x:\n",
    "        x.append(i[0][0])\n",
    "    if i[0][1] not in y:\n",
    "        y.append(i[0][1])\n",
    "print(x)\n",
    "print(y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "info.鞋面材质   info.风格\n",
       "头层牛皮（除牛反绒）  商务         1618\n",
       "            休闲         1170\n",
       "PU          休闲          395\n",
       "二层牛皮（除牛反绒）  休闲          271\n",
       "            商务          221\n",
       "头层牛皮（除牛反绒）  青春潮流        199\n",
       "            简约          128\n",
       "            英伦          111\n",
       "PU          商务           97\n",
       "            青春潮流         78\n",
       "二层牛皮（除牛反绒）  青春潮流         64\n",
       "头层牛皮（除牛反绒）  韩版           44\n",
       "PU          韩版           43\n",
       "头层牛皮（除牛反绒）  运动           42\n",
       "PU          英伦           41\n",
       "人造革         休闲           36\n",
       "超纤          休闲           22\n",
       "人造革         青春潮流         19\n",
       "二层牛皮（除牛反绒）  英伦           19\n",
       "PU          运动           13\n",
       "二层牛皮（除牛反绒）  韩版           12\n",
       "人造革         英伦           11\n",
       "超纤          商务           10\n",
       "牛反绒         休闲            8\n",
       "磨砂皮         休闲            8\n",
       "人造革         商务            8\n",
       "绒面          韩版            6\n",
       "二层牛皮（除牛反绒）  运动            6\n",
       "多种材质拼接      商务            6\n",
       "太空革         休闲            6\n",
       "                       ... \n",
       "绒面          青春潮流          2\n",
       "二层猪皮        青春潮流          2\n",
       "磨砂皮         商务            2\n",
       "牛反绒         运动            2\n",
       "头层牛皮（除牛反绒）  民族风           2\n",
       "牛反绒         青春潮流          2\n",
       "头层猪皮        休闲            2\n",
       "多种材质拼接      英伦            2\n",
       "头层猪皮        商务            2\n",
       "二层牛皮（除牛反绒）  简约            1\n",
       "超纤          青春潮流          1\n",
       "PU          简约            1\n",
       "超纤          英伦            1\n",
       "            复古            1\n",
       "羊皮毛一体       商务            1\n",
       "太空革         韩版            1\n",
       "            商务            1\n",
       "二层牛皮（除牛反绒）  复古            1\n",
       "棉布          休闲            1\n",
       "塑胶          休闲            1\n",
       "绒面          商务            1\n",
       "头层猪皮        韩版            1\n",
       "多种材质拼接      运动            1\n",
       "磨砂皮         英伦            1\n",
       "多种材质拼接      简约            1\n",
       "超纤皮         韩版            1\n",
       "多种材质拼接      复古            1\n",
       "牛仔布         韩版            1\n",
       "            商务            1\n",
       "头层猪皮        英伦            1\n",
       "Length: 75, dtype: int64"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 仿照官网的例子做出3d柱状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['PU', '二层牛皮（除牛反绒）', '二层猪皮', '人造革', '塑胶', '多种材质拼接', '太空革', '头层牛皮（除牛反绒）', '头层猪皮', '布', '棉布', '牛仔布', '牛反绒', '磨砂皮', '绒面', '网布', '羊皮毛一体', '超纤', '超纤皮', '鳄鱼皮']\n",
      "['休闲', '商务', '民族风', '简约', '英伦', '运动', '青春潮流', '韩版', '复古', '欧美']\n"
     ]
    }
   ],
   "source": [
    "x=[]\n",
    "y=[]\n",
    "for i in p0.items():\n",
    "    if i[0][0] not in x:\n",
    "        x.append(i[0][0])\n",
    "    if i[0][1] not in y:\n",
    "        y.append(i[0][1])\n",
    "print(x)\n",
    "print(y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=[]\n",
    "y=[]\n",
    "data=[]\n",
    "n=0\n",
    "for i in p0.items():\n",
    "    if i[0][0] not in x:\n",
    "        x.append(i[0][0])\n",
    "    if i[0][1] not in y:\n",
    "        y.append(i[0][1])\n",
    "    data.append([x.index(i[0][0]),y.index(i[0][1]),i[1]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['PU', '二层牛皮（除牛反绒）', '二层猪皮', '人造革', '塑胶', '多种材质拼接', '太空革', '头层牛皮（除牛反绒）', '头层猪皮', '布', '棉布', '牛仔布', '牛反绒', '磨砂皮', '绒面', '网布', '羊皮毛一体', '超纤', '超纤皮', '鳄鱼皮']\n",
      "['休闲', '商务', '民族风', '简约', '英伦', '运动', '青春潮流', '韩版', '复古', '欧美']\n"
     ]
    }
   ],
   "source": [
    "print(x)\n",
    "print(y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[0, 0, 395],\n",
       " [0, 1, 97],\n",
       " [0, 2, 2],\n",
       " [0, 3, 1],\n",
       " [0, 4, 41],\n",
       " [0, 5, 13],\n",
       " [0, 6, 78],\n",
       " [0, 7, 43],\n",
       " [1, 0, 271],\n",
       " [1, 1, 221],\n",
       " [1, 8, 1],\n",
       " [1, 3, 1],\n",
       " [1, 4, 19],\n",
       " [1, 5, 6],\n",
       " [1, 6, 64],\n",
       " [1, 7, 12],\n",
       " [2, 0, 5],\n",
       " [2, 6, 2],\n",
       " [3, 0, 36],\n",
       " [3, 1, 8],\n",
       " [3, 4, 11],\n",
       " [3, 6, 19],\n",
       " [3, 7, 6],\n",
       " [4, 0, 1],\n",
       " [5, 0, 4],\n",
       " [5, 1, 6],\n",
       " [5, 8, 1],\n",
       " [5, 3, 1],\n",
       " [5, 4, 2],\n",
       " [5, 5, 1],\n",
       " [5, 6, 4],\n",
       " [6, 0, 6],\n",
       " [6, 1, 1],\n",
       " [6, 7, 1],\n",
       " [7, 0, 1170],\n",
       " [7, 1, 1618],\n",
       " [7, 8, 3],\n",
       " [7, 9, 3],\n",
       " [7, 2, 2],\n",
       " [7, 3, 128],\n",
       " [7, 4, 111],\n",
       " [7, 5, 42],\n",
       " [7, 6, 199],\n",
       " [7, 7, 44],\n",
       " [8, 0, 2],\n",
       " [8, 1, 2],\n",
       " [8, 4, 1],\n",
       " [8, 7, 1],\n",
       " [9, 0, 6],\n",
       " [9, 5, 2],\n",
       " [10, 0, 1],\n",
       " [11, 1, 1],\n",
       " [11, 7, 1],\n",
       " [12, 0, 8],\n",
       " [12, 5, 2],\n",
       " [12, 6, 2],\n",
       " [13, 0, 8],\n",
       " [13, 1, 2],\n",
       " [13, 4, 1],\n",
       " [13, 6, 3],\n",
       " [14, 0, 3],\n",
       " [14, 1, 1],\n",
       " [14, 4, 3],\n",
       " [14, 6, 2],\n",
       " [14, 7, 6],\n",
       " [15, 0, 3],\n",
       " [15, 5, 2],\n",
       " [16, 1, 1],\n",
       " [17, 0, 22],\n",
       " [17, 1, 10],\n",
       " [17, 8, 1],\n",
       " [17, 4, 1],\n",
       " [17, 6, 1],\n",
       " [18, 7, 1],\n",
       " [19, 1, 4]]"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'echarts-gl':'https://assets.pyecharts.org/assets/echarts-gl.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"000deeb9427f4ce0a48fa8dbe60e7cc5\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'echarts-gl'], function(echarts) {\n",
       "                var chart_000deeb9427f4ce0a48fa8dbe60e7cc5 = echarts.init(\n",
       "                    document.getElementById('000deeb9427f4ce0a48fa8dbe60e7cc5'), 'white', {renderer: 'canvas'});\n",
       "                var option_000deeb9427f4ce0a48fa8dbe60e7cc5 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar3D\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0,\n",
       "                    1618\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    1,\n",
       "                    1170\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    1,\n",
       "                    395\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    1,\n",
       "                    271\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    0,\n",
       "                    221\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    2,\n",
       "                    199\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    3,\n",
       "                    128\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    4,\n",
       "                    111\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    0,\n",
       "                    97\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    2,\n",
       "                    78\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    2,\n",
       "                    64\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    5,\n",
       "                    44\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    5,\n",
       "                    43\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    6,\n",
       "                    42\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    4,\n",
       "                    41\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    1,\n",
       "                    36\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    1,\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    2,\n",
       "                    19\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    4,\n",
       "                    19\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    6,\n",
       "                    13\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    5,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    4,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    0,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    1,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    1,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    0,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    5,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    6,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    0,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    1,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    1,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    5,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    1,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    2,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    1,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    0,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    7,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    8,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    1,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    4,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    1,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    2,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    6,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    9,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    6,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    2,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    2,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    0,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    6,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    9,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    2,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    1,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    4,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    0,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    3,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    2,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    3,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    4,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    8,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    8,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    1,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    1,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    6,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    4,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    3,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    8,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    4,\n",
       "                    1\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 20,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true\n",
       "    },\n",
       "    \"xAxis3D\": {\n",
       "        \"data\": [\n",
       "            \"\\u5934\\u5c42\\u725b\\u76ae\\uff08\\u9664\\u725b\\u53cd\\u7ed2\\uff09\",\n",
       "            \"PU\",\n",
       "            \"\\u4e8c\\u5c42\\u725b\\u76ae\\uff08\\u9664\\u725b\\u53cd\\u7ed2\\uff09\",\n",
       "            \"\\u4eba\\u9020\\u9769\",\n",
       "            \"\\u8d85\\u7ea4\",\n",
       "            \"\\u725b\\u53cd\\u7ed2\",\n",
       "            \"\\u78e8\\u7802\\u76ae\",\n",
       "            \"\\u7ed2\\u9762\",\n",
       "            \"\\u591a\\u79cd\\u6750\\u8d28\\u62fc\\u63a5\",\n",
       "            \"\\u592a\\u7a7a\\u9769\",\n",
       "            \"\\u5e03\",\n",
       "            \"\\u4e8c\\u5c42\\u732a\\u76ae\",\n",
       "            \"\\u9cc4\\u9c7c\\u76ae\",\n",
       "            \"\\u7f51\\u5e03\",\n",
       "            \"\\u5934\\u5c42\\u732a\\u76ae\",\n",
       "            \"\\u7f8a\\u76ae\\u6bdb\\u4e00\\u4f53\",\n",
       "            \"\\u68c9\\u5e03\",\n",
       "            \"\\u5851\\u80f6\",\n",
       "            \"\\u8d85\\u7ea4\\u76ae\",\n",
       "            \"\\u725b\\u4ed4\\u5e03\"\n",
       "        ],\n",
       "        \"nameGap\": 20,\n",
       "        \"type\": \"category\",\n",
       "        \"axisLabel\": {\n",
       "            \"margin\": 8\n",
       "        }\n",
       "    },\n",
       "    \"yAxis3D\": {\n",
       "        \"data\": [\n",
       "            \"\\u5546\\u52a1\",\n",
       "            \"\\u4f11\\u95f2\",\n",
       "            \"\\u9752\\u6625\\u6f6e\\u6d41\",\n",
       "            \"\\u7b80\\u7ea6\",\n",
       "            \"\\u82f1\\u4f26\",\n",
       "            \"\\u97e9\\u7248\",\n",
       "            \"\\u8fd0\\u52a8\",\n",
       "            \"\\u6b27\\u7f8e\",\n",
       "            \"\\u590d\\u53e4\",\n",
       "            \"\\u6c11\\u65cf\\u98ce\"\n",
       "        ],\n",
       "        \"nameGap\": 20,\n",
       "        \"type\": \"category\",\n",
       "        \"axisLabel\": {\n",
       "            \"margin\": 8\n",
       "        }\n",
       "    },\n",
       "    \"zAxis3D\": {\n",
       "        \"nameGap\": 20,\n",
       "        \"type\": \"value\",\n",
       "        \"axisLabel\": {\n",
       "            \"margin\": 8\n",
       "        }\n",
       "    },\n",
       "    \"grid3D\": {\n",
       "        \"boxWidth\": 200,\n",
       "        \"boxHeight\": 100,\n",
       "        \"boxDepth\": 80,\n",
       "        \"viewControl\": {\n",
       "            \"autoRotate\": false,\n",
       "            \"autoRotateSpeed\": 10,\n",
       "            \"rotateSensitivity\": 1\n",
       "        }\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Bar3D-\\u57fa\\u672c\\u793a\\u4f8b\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_000deeb9427f4ce0a48fa8dbe60e7cc5.setOption(option_000deeb9427f4ce0a48fa8dbe60e7cc5);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11366dd5f60>"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f3=Bar3D()\n",
    "f3.add(\"\",data,\n",
    "       xaxis3d_opts=opts.Axis3DOpts(x, type_=\"category\"),\n",
    "       yaxis3d_opts=opts.Axis3DOpts(y, type_=\"category\"),\n",
    "       zaxis3d_opts=opts.Axis3DOpts(type_=\"value\")\n",
    "      ).set_global_opts(\n",
    "        visualmap_opts=opts.VisualMapOpts(max_=20),\n",
    "        title_opts=opts.TitleOpts(title=\"Bar3D-基本示例\"),\n",
    "        )\n",
    "f3.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 热图\n",
    "\n",
    "仿照官网热图做出上面数据的热图,注意这里的数据格式和3d柱状图基本是一样的，变化的只有引入数据的函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "from pyecharts.faker import  Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import HeatMap"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"e77385da8ab940628a19baff2b9f4483\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_e77385da8ab940628a19baff2b9f4483 = echarts.init(\n",
       "                    document.getElementById('e77385da8ab940628a19baff2b9f4483'), 'white', {renderer: 'canvas'});\n",
       "                var option_e77385da8ab940628a19baff2b9f4483 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"heatmap\",\n",
       "            \"name\": \"series0\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0,\n",
       "                    0,\n",
       "                    1618\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    1,\n",
       "                    1170\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    1,\n",
       "                    395\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    1,\n",
       "                    271\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    0,\n",
       "                    221\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    2,\n",
       "                    199\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    3,\n",
       "                    128\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    4,\n",
       "                    111\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    0,\n",
       "                    97\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    2,\n",
       "                    78\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    2,\n",
       "                    64\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    5,\n",
       "                    44\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    5,\n",
       "                    43\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    6,\n",
       "                    42\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    4,\n",
       "                    41\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    1,\n",
       "                    36\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    1,\n",
       "                    22\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    2,\n",
       "                    19\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    4,\n",
       "                    19\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    6,\n",
       "                    13\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    5,\n",
       "                    12\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    4,\n",
       "                    11\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    0,\n",
       "                    10\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    1,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    1,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    0,\n",
       "                    8\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    5,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    6,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    0,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    1,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    1,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    5,\n",
       "                    6\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    1,\n",
       "                    5\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    2,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    1,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    0,\n",
       "                    4\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    7,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    8,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    1,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    4,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    1,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    2,\n",
       "                    3\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    6,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    9,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    13,\n",
       "                    6,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    2,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    2,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    0,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    6,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    0,\n",
       "                    9,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    2,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    1,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    4,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    0,\n",
       "                    2\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    3,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    2,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    1,\n",
       "                    3,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    4,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    8,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    15,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    8,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    16,\n",
       "                    1,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    17,\n",
       "                    1,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    6,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    4,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    3,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    18,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    8,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    5,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    19,\n",
       "                    0,\n",
       "                    1\n",
       "                ],\n",
       "                [\n",
       "                    14,\n",
       "                    4,\n",
       "                    1\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"series0\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"series0\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5934\\u5c42\\u725b\\u76ae\\uff08\\u9664\\u725b\\u53cd\\u7ed2\\uff09\",\n",
       "                \"PU\",\n",
       "                \"\\u4e8c\\u5c42\\u725b\\u76ae\\uff08\\u9664\\u725b\\u53cd\\u7ed2\\uff09\",\n",
       "                \"\\u4eba\\u9020\\u9769\",\n",
       "                \"\\u8d85\\u7ea4\",\n",
       "                \"\\u725b\\u53cd\\u7ed2\",\n",
       "                \"\\u78e8\\u7802\\u76ae\",\n",
       "                \"\\u7ed2\\u9762\",\n",
       "                \"\\u591a\\u79cd\\u6750\\u8d28\\u62fc\\u63a5\",\n",
       "                \"\\u592a\\u7a7a\\u9769\",\n",
       "                \"\\u5e03\",\n",
       "                \"\\u4e8c\\u5c42\\u732a\\u76ae\",\n",
       "                \"\\u9cc4\\u9c7c\\u76ae\",\n",
       "                \"\\u7f51\\u5e03\",\n",
       "                \"\\u5934\\u5c42\\u732a\\u76ae\",\n",
       "                \"\\u7f8a\\u76ae\\u6bdb\\u4e00\\u4f53\",\n",
       "                \"\\u68c9\\u5e03\",\n",
       "                \"\\u5851\\u80f6\",\n",
       "                \"\\u8d85\\u7ea4\\u76ae\",\n",
       "                \"\\u725b\\u4ed4\\u5e03\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u52a1\",\n",
       "                \"\\u4f11\\u95f2\",\n",
       "                \"\\u9752\\u6625\\u6f6e\\u6d41\",\n",
       "                \"\\u7b80\\u7ea6\",\n",
       "                \"\\u82f1\\u4f26\",\n",
       "                \"\\u97e9\\u7248\",\n",
       "                \"\\u8fd0\\u52a8\",\n",
       "                \"\\u6b27\\u7f8e\",\n",
       "                \"\\u590d\\u53e4\",\n",
       "                \"\\u6c11\\u65cf\\u98ce\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"HeatMap-\\u57fa\\u672c\\u793a\\u4f8b\"\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true\n",
       "    }\n",
       "};\n",
       "                chart_e77385da8ab940628a19baff2b9f4483.setOption(option_e77385da8ab940628a19baff2b9f4483);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11366e12828>"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f4=HeatMap()\n",
    "f4.add_xaxis(x)\n",
    "f4.add_yaxis(\"series0\", y, data)\n",
    "f4.set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"HeatMap-基本示例\"),\n",
    "            visualmap_opts=opts.VisualMapOpts(),\n",
    "        )\n",
    "f4.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 店铺特征矩阵的构建"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#a.sales"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "#把商品销量提取出来，并把对应列表的类型转化为数\n",
    "a.sales=a.sales.str.split(\"人\",expand=True)[0]\n",
    "a.sales = a.sales.astype(np.int64)#转换列的类型为整数\n",
    "a.price = a.price.astype(np.float)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#求出各个商品的销售额并把它并入到原始数据框中去\n",
    "z1=a.sales*a.price\n",
    "z1.name=\"xse\"\n",
    "a1=pd.concat([a,z1],axis=1)#给序列命名之后添加入数据框就会直接以序列名作为列标"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#a1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>_id.$oid</th>\n",
       "      <th>info.上市年份季节</th>\n",
       "      <th>info.上市时间</th>\n",
       "      <th>info.产品名称</th>\n",
       "      <th>info.低帮鞋品名</th>\n",
       "      <th>info.功能</th>\n",
       "      <th>info.吊牌价</th>\n",
       "      <th>info.品牌</th>\n",
       "      <th>info.图案</th>\n",
       "      <th>info.场合</th>\n",
       "      <th>...</th>\n",
       "      <th>info.颜色分类</th>\n",
       "      <th>info.风格</th>\n",
       "      <th>itemid</th>\n",
       "      <th>location</th>\n",
       "      <th>nick</th>\n",
       "      <th>price</th>\n",
       "      <th>sales</th>\n",
       "      <th>title</th>\n",
       "      <th>url</th>\n",
       "      <th>xse</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5aa77041be9b0338dc1faab4</td>\n",
       "      <td>2018年春季</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>商务休闲鞋</td>\n",
       "      <td>轻质</td>\n",
       "      <td>NaN</td>\n",
       "      <td>YEARCON/意尔康</td>\n",
       "      <td>纯色</td>\n",
       "      <td>日常</td>\n",
       "      <td>...</td>\n",
       "      <td>黑色土黄</td>\n",
       "      <td>商务</td>\n",
       "      <td>562121114807</td>\n",
       "      <td>浙江 丽水</td>\n",
       "      <td>意尔康皮鞋旗舰店</td>\n",
       "      <td>269.0</td>\n",
       "      <td>1583</td>\n",
       "      <td>意尔康男鞋2018春季新款英伦真皮商务休闲皮鞋青年男士皮鞋子男潮</td>\n",
       "      <td>http://detail.tmall.com/item.htm?id=5621211148...</td>\n",
       "      <td>425827.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5aa77042be9b0338dc1faab5</td>\n",
       "      <td>2017年秋季</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>商务休闲鞋</td>\n",
       "      <td>轻质</td>\n",
       "      <td>NaN</td>\n",
       "      <td>YEARCON/意尔康</td>\n",
       "      <td>纯色</td>\n",
       "      <td>办公室</td>\n",
       "      <td>...</td>\n",
       "      <td>黑色棕色黑色加绒版棕色加绒版黑色镂空棕色镂空</td>\n",
       "      <td>商务</td>\n",
       "      <td>545941839337</td>\n",
       "      <td>浙江 丽水</td>\n",
       "      <td>意尔康皮鞋旗舰店</td>\n",
       "      <td>199.0</td>\n",
       "      <td>1607</td>\n",
       "      <td>意尔康旗舰店官方店男鞋春秋真皮爸爸鞋中老年人商务休闲皮鞋子男</td>\n",
       "      <td>http://detail.tmall.com/item.htm?id=5459418393...</td>\n",
       "      <td>319793.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2 rows × 53 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                   _id.$oid info.上市年份季节 info.上市时间 info.产品名称 info.低帮鞋品名  \\\n",
       "0  5aa77041be9b0338dc1faab4     2018年春季       NaN       NaN      商务休闲鞋   \n",
       "1  5aa77042be9b0338dc1faab5     2017年秋季       NaN       NaN      商务休闲鞋   \n",
       "\n",
       "  info.功能 info.吊牌价      info.品牌 info.图案 info.场合    ...     \\\n",
       "0      轻质      NaN  YEARCON/意尔康      纯色      日常    ...      \n",
       "1      轻质      NaN  YEARCON/意尔康      纯色     办公室    ...      \n",
       "\n",
       "                info.颜色分类 info.风格        itemid location      nick  price  \\\n",
       "0                    黑色土黄      商务  562121114807    浙江 丽水  意尔康皮鞋旗舰店  269.0   \n",
       "1  黑色棕色黑色加绒版棕色加绒版黑色镂空棕色镂空      商务  545941839337    浙江 丽水  意尔康皮鞋旗舰店  199.0   \n",
       "\n",
       "  sales                             title  \\\n",
       "0  1583  意尔康男鞋2018春季新款英伦真皮商务休闲皮鞋青年男士皮鞋子男潮   \n",
       "1  1607    意尔康旗舰店官方店男鞋春秋真皮爸爸鞋中老年人商务休闲皮鞋子男   \n",
       "\n",
       "                                                 url       xse  \n",
       "0  http://detail.tmall.com/item.htm?id=5621211148...  425827.0  \n",
       "1  http://detail.tmall.com/item.htm?id=5459418393...  319793.0  \n",
       "\n",
       "[2 rows x 53 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a1.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "381.7666666666668\n",
      "199.0\n",
      "158.0\n",
      "540.8333333333334\n",
      "98.5\n",
      "155.7\n",
      "310.23809523809524\n",
      "163.0\n",
      "148.0\n",
      "150.5\n",
      "296.0\n",
      "123.16666666666667\n",
      "168.0\n",
      "148.0\n",
      "158.0\n",
      "189.0\n",
      "401.6923076923077\n",
      "164.0\n",
      "158.0\n",
      "368.5\n",
      "173.0\n",
      "163.125\n",
      "139.0\n",
      "151.33333333333334\n",
      "388.0\n",
      "164.66666666666666\n",
      "305.0\n",
      "178.0\n",
      "161.33333333333334\n",
      "164.0\n",
      "159.0\n",
      "521.3333333333334\n",
      "233.0\n",
      "155.66666666666666\n",
      "179.0\n",
      "170.33333333333334\n",
      "168.0\n",
      "146.66666666666666\n",
      "171.6\n",
      "334.0\n",
      "276.0\n",
      "228.0\n",
      "381.6000000000002\n",
      "359.0\n",
      "225.0\n",
      "124.66666666666667\n",
      "128.5\n",
      "138.0\n",
      "148.0\n",
      "146.16666666666666\n",
      "325.3333333333333\n",
      "161.66666666666666\n",
      "328.0\n",
      "176.0\n",
      "168.0\n",
      "384.51176470588257\n",
      "166.0\n",
      "228.33333333333334\n",
      "388.0\n",
      "486.8484848484849\n",
      "598.0\n",
      "148.0\n",
      "358.02564102564105\n",
      "329.0\n",
      "238.0\n",
      "268.0\n",
      "298.3333333333333\n",
      "423.09090909090907\n",
      "1458.0\n",
      "151.25\n",
      "323.8421052631579\n",
      "173.0\n",
      "169.0\n",
      "159.0\n",
      "160.875\n",
      "168.0\n",
      "158.0\n",
      "348.0\n",
      "148.0\n",
      "998.0\n",
      "368.0\n",
      "208.0\n",
      "209.0\n",
      "151.66666666666666\n",
      "158.0\n",
      "102.88888888888889\n",
      "386.7142857142857\n",
      "129.8\n",
      "128.0\n",
      "168.0\n",
      "352.0\n",
      "166.25\n",
      "138.0\n",
      "198.0\n",
      "328.57377049180326\n",
      "158.0\n",
      "148.0\n",
      "275.0833333333333\n",
      "160.6\n",
      "139.0\n",
      "498.0\n",
      "413.5\n",
      "120.44444444444444\n",
      "436.0\n",
      "147.44444444444446\n",
      "158.0\n",
      "390.2564\n",
      "148.0\n",
      "262.0\n",
      "160.16\n",
      "380.31428571428586\n",
      "152.6\n",
      "158.0\n",
      "113.5\n",
      "116.875\n",
      "166.2\n",
      "138.33333333333334\n",
      "426.58620689655174\n",
      "469.0\n",
      "178.0\n",
      "158.0\n",
      "158.0\n",
      "384.60000000000014\n",
      "17.9\n",
      "398.6666666666667\n",
      "138.0\n",
      "133.0\n",
      "270.39285714285717\n",
      "128.33333333333334\n",
      "398.5\n",
      "709.0\n",
      "122.8\n",
      "153.0\n",
      "128.0\n",
      "305.6666666666667\n",
      "330.4\n",
      "158.0\n",
      "128.0\n",
      "251.41666666666666\n",
      "223.725\n",
      "113.0\n",
      "219.0\n",
      "158.0\n",
      "168.0\n",
      "128.0\n",
      "688.0\n",
      "244.925\n",
      "273.00735294117646\n",
      "439.0\n",
      "158.0\n",
      "161.33333333333334\n",
      "356.0\n",
      "351.8125\n",
      "160.75\n",
      "160.55555555555554\n",
      "368.0\n",
      "138.0\n",
      "356.3333333333333\n",
      "150.14634146341464\n",
      "148.0\n",
      "691.5\n",
      "164.66666666666666\n",
      "128.0\n",
      "143.0\n",
      "168.0\n",
      "120.98666666666668\n",
      "118.0\n",
      "16.9\n",
      "166.9090909090909\n",
      "160.33333333333334\n",
      "151.66666666666666\n",
      "375.1333333333333\n",
      "139.0\n",
      "225.8\n",
      "148.0\n",
      "158.0\n",
      "164.64\n",
      "184.0\n",
      "138.0\n",
      "203.0\n",
      "184.66666666666666\n",
      "161.33333333333334\n",
      "384.3000000000002\n",
      "114.66666666666667\n",
      "196.45299145299145\n",
      "166.33333333333334\n",
      "229.0\n",
      "222.39705882352942\n",
      "268.0\n",
      "432.3333333333333\n",
      "339.0\n",
      "322.5\n",
      "204.4794520547945\n",
      "152.66666666666666\n",
      "219.0\n",
      "357.84\n",
      "488.0\n",
      "152.0\n",
      "138.0\n",
      "148.0\n",
      "158.0\n",
      "168.0\n",
      "163.0\n",
      "329.0\n",
      "189.0\n",
      "138.0\n",
      "163.5\n",
      "164.0\n",
      "243.0\n",
      "18.0\n",
      "121.33333333333333\n",
      "157.5\n",
      "158.0\n",
      "163.71428571428572\n",
      "358.0\n",
      "18.0\n",
      "393.5\n",
      "596.0\n",
      "58.0\n",
      "163.33333333333334\n",
      "157.33333333333334\n",
      "171.36363636363637\n",
      "173.44444444444446\n",
      "402.3333333333333\n",
      "198.0\n",
      "159.8\n",
      "498.0\n",
      "192.06837606837607\n",
      "129.0\n",
      "149.0\n",
      "139.0\n",
      "159.0\n",
      "118.25\n",
      "148.0\n",
      "229.72500000000002\n",
      "164.66666666666666\n",
      "377.1\n",
      "376.0411764705883\n",
      "201.75\n",
      "157.29\n",
      "396.61206896551727\n",
      "330.0\n",
      "148.71428571428572\n",
      "375.78\n",
      "158.5\n",
      "258.0\n",
      "131.5\n",
      "279.0\n",
      "448.0\n",
      "308.6666666666667\n",
      "148.0\n",
      "148.0\n",
      "288.0\n",
      "158.0\n",
      "748.0\n",
      "389.41578947368436\n",
      "160.33333333333334\n",
      "173.0\n",
      "158.5\n",
      "308.8\n",
      "329.4761904761905\n",
      "160.2\n",
      "254.0235294117647\n",
      "161.33333333333334\n",
      "148.0\n",
      "383.40000000000015\n",
      "389.70000000000016\n",
      "115.0\n",
      "89.0\n",
      "161.33333333333334\n",
      "135.0\n",
      "123.0\n",
      "135.0\n",
      "376.6909090909092\n",
      "183.5\n",
      "158.0\n",
      "156.0\n",
      "120.5\n",
      "108.66666666666667\n",
      "123.0\n",
      "158.0\n",
      "271.46153846153845\n",
      "123.0\n",
      "159.0\n",
      "680.8120805369127\n",
      "485.7128027681661\n",
      "385.6666666666667\n",
      "169.0\n",
      "151.0\n",
      "158.0\n",
      "164.16666666666666\n",
      "321.3376623376623\n",
      "139.0\n",
      "135.0\n",
      "161.5\n",
      "149.0\n",
      "119.9\n",
      "418.0\n",
      "381.3076923076923\n",
      "219.66666666666666\n",
      "174.66666666666666\n",
      "231.5\n",
      "153.0\n",
      "158.0\n",
      "235.33333333333334\n",
      "236.38000000000002\n",
      "157.375\n",
      "158.4\n",
      "380.4\n",
      "163.0\n",
      "111.0\n",
      "158.0\n",
      "239.0\n",
      "148.11111111111111\n",
      "332.8\n",
      "133.25\n",
      "158.0\n",
      "221.33333333333334\n",
      "370.0\n",
      "148.0\n",
      "257.0\n",
      "206.6\n",
      "173.0\n",
      "169.72\n",
      "238.16666666666666\n",
      "133.0\n",
      "158.0\n",
      "351.0\n",
      "161.33333333333334\n",
      "159.5\n",
      "145.2\n",
      "158.0\n",
      "148.0\n",
      "191.1875\n",
      "143.5\n",
      "222.33333333333334\n",
      "156.0\n",
      "170.66666666666666\n",
      "158.0\n",
      "255.66666666666666\n",
      "138.0\n",
      "88.0\n",
      "180.33333333333334\n",
      "157.0\n",
      "150.5\n",
      "128.0\n",
      "18.0\n",
      "169.0\n",
      "178.0\n",
      "143.0\n",
      "146.0\n",
      "168.0\n",
      "155.0\n",
      "165.0\n",
      "148.885\n",
      "178.0\n",
      "135.24\n",
      "25.0\n",
      "379.3333333333333\n",
      "168.0\n",
      "148.0\n",
      "209.66666666666666\n",
      "498.0\n",
      "249.0\n",
      "578.0\n",
      "168.66666666666666\n",
      "292.9855072463768\n",
      "235.02\n",
      "208.66666666666666\n",
      "468.5\n",
      "168.0\n",
      "144.2\n",
      "79.0\n",
      "158.0\n",
      "168.34\n",
      "118.0\n",
      "279.0\n",
      "380.84671532846716\n",
      "257.4\n",
      "166.33333333333334\n",
      "182.8\n",
      "409.75\n",
      "354.0327868852459\n",
      "197.0\n",
      "240.25\n",
      "195.50632911392404\n",
      "159.0\n",
      "380.22\n",
      "364.375\n",
      "99.0\n",
      "150.12\n",
      "165.0\n",
      "158.0\n",
      "168.0\n",
      "134.66666666666666\n",
      "128.0\n",
      "238.5\n",
      "364.90697674418607\n",
      "213.0\n",
      "238.0\n",
      "228.0\n",
      "218.0\n",
      "173.5\n",
      "298.0\n",
      "118.33333333333333\n",
      "169.0\n",
      "163.0\n",
      "369.17241379310343\n",
      "165.125\n",
      "161.33333333333334\n",
      "376.72500000000014\n",
      "149.0\n",
      "256.10714285714283\n",
      "158.0\n",
      "407.3333333333333\n",
      "219.0\n",
      "130.75\n",
      "152.33333333333334\n",
      "123.5\n",
      "354.6\n",
      "193.96999999999997\n",
      "571.0\n",
      "163.55555555555554\n",
      "168.0\n",
      "99.0\n",
      "598.0\n",
      "362.3025\n",
      "158.35\n",
      "190.25\n",
      "235.3913043478261\n",
      "125.44\n",
      "193.0\n",
      "156.0\n",
      "229.0\n",
      "347.5769230769231\n",
      "233.0\n",
      "178.0\n",
      "328.0\n",
      "159.0\n",
      "131.66666666666666\n",
      "158.0\n",
      "158.0\n",
      "163.58333333333334\n",
      "184.19545454545454\n",
      "193.84444444444443\n",
      "238.25\n",
      "154.66666666666666\n",
      "269.7857142857143\n",
      "228.8\n",
      "125.5\n",
      "255.86363636363637\n",
      "150.78\n",
      "391.0\n",
      "141.33333333333334\n",
      "148.0\n",
      "156.0\n",
      "69.0\n",
      "453.2857142857143\n",
      "158.0\n",
      "157.0\n",
      "154.11111111111111\n",
      "212.11111111111111\n",
      "349.5\n",
      "508.0\n",
      "143.5\n",
      "129.5\n",
      "149.0\n",
      "118.99\n",
      "187.2155172413793\n",
      "138.0\n",
      "168.0\n",
      "262.3333333333333\n",
      "288.0\n",
      "207.84137931034482\n",
      "380.918181818182\n",
      "236.0\n",
      "439.0\n",
      "167.28571428571428\n",
      "157.0\n",
      "271.0\n",
      "176.55944055944056\n",
      "158.66666666666666\n"
     ]
    }
   ],
   "source": [
    "for i in a1.groupby(\"nick\"):\n",
    "    print(len(i[1]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "#先做成字典，把各个特征放入字典中\n",
    "te_zheng={\"nick\":[],\"z_xse\":[],\"z_num\":[],\"p_sales\":[],\"p_bdj\":[],\"p_price\":[]}\n",
    "for i in a1.groupby(\"nick\"):\n",
    "    te_zheng[\"nick\"].append(i[0])\n",
    "    te_zheng[\"z_xse\"].append(i[1].xse.sum())\n",
    "    te_zheng[\"z_num\"].append(len(i[1]))\n",
    "    te_zheng[\"p_sales\"].append(round(i[1].sales.mean(),1))\n",
    "    if i[1].sales.sum()==0:#存在除零的情况，所以做判断\n",
    "        te_zheng[\"p_bdj\"].append(0)\n",
    "    else:\n",
    "        te_zheng[\"p_bdj\"].append(round(i[1].xse.sum()/i[1].sales.sum(),1))\n",
    "    te_zheng[\"p_price\"].append(round(i[1].price.mean(),1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>nick</th>\n",
       "      <th>z_xse</th>\n",
       "      <th>z_num</th>\n",
       "      <th>p_sales</th>\n",
       "      <th>p_bdj</th>\n",
       "      <th>p_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>285</th>\n",
       "      <td>意尔康皮鞋旗舰店</td>\n",
       "      <td>3558446.0</td>\n",
       "      <td>289</td>\n",
       "      <td>47.8</td>\n",
       "      <td>257.4</td>\n",
       "      <td>485.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>284</th>\n",
       "      <td>意尔康男鞋旗舰店</td>\n",
       "      <td>792685.0</td>\n",
       "      <td>149</td>\n",
       "      <td>18.0</td>\n",
       "      <td>296.3</td>\n",
       "      <td>680.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>281</th>\n",
       "      <td>意尔康品牌店</td>\n",
       "      <td>114452.0</td>\n",
       "      <td>65</td>\n",
       "      <td>7.7</td>\n",
       "      <td>229.8</td>\n",
       "      <td>271.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161</th>\n",
       "      <td>乙方乙方88888</td>\n",
       "      <td>88144.0</td>\n",
       "      <td>9</td>\n",
       "      <td>60.3</td>\n",
       "      <td>162.3</td>\n",
       "      <td>164.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>吸引力xl</td>\n",
       "      <td>43870.0</td>\n",
       "      <td>5</td>\n",
       "      <td>59.0</td>\n",
       "      <td>148.7</td>\n",
       "      <td>152.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          nick      z_xse  z_num  p_sales  p_bdj  p_price\n",
       "285   意尔康皮鞋旗舰店  3558446.0    289     47.8  257.4    485.7\n",
       "284   意尔康男鞋旗舰店   792685.0    149     18.0  296.3    680.8\n",
       "281     意尔康品牌店   114452.0     65      7.7  229.8    271.5\n",
       "161  乙方乙方88888    88144.0      9     60.3  162.3    164.7\n",
       "197      吸引力xl    43870.0      5     59.0  148.7    152.0"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 把字典转化为数据框，并基于销售额排序\n",
    "df_te_zheng=pd.DataFrame(te_zheng)\n",
    "df_te_zheng.sort_values(by=\"z_xse\",ascending=False,inplace=True)\n",
    "df_te_zheng.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 散点图\n",
    "\n",
    "* 基于店铺特征矩阵做散点图，注意pyechart的x轴通常默认为类别轴，需要重新设定为数值轴"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts.charts import Scatter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"0deecf960109499faa1d38af07c046d2\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_0deecf960109499faa1d38af07c046d2 = echarts.init(\n",
       "                    document.getElementById('0deecf960109499faa1d38af07c046d2'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_0deecf960109499faa1d38af07c046d2 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    3558446.0,\n",
       "                    257.4\n",
       "                ],\n",
       "                [\n",
       "                    792685.0,\n",
       "                    296.3\n",
       "                ],\n",
       "                [\n",
       "                    114452.0,\n",
       "                    229.8\n",
       "                ],\n",
       "                [\n",
       "                    88144.0,\n",
       "                    162.3\n",
       "                ],\n",
       "                [\n",
       "                    43870.0,\n",
       "                    148.7\n",
       "                ],\n",
       "                [\n",
       "                    42636.0,\n",
       "                    325.5\n",
       "                ],\n",
       "                [\n",
       "                    36617.0,\n",
       "                    171.9\n",
       "                ],\n",
       "                [\n",
       "                    27966.0,\n",
       "                    158.0\n",
       "                ],\n",
       "                [\n",
       "                    25032.0,\n",
       "                    168.0\n",
       "                ],\n",
       "                [\n",
       "                    23376.0,\n",
       "                    170.6\n",
       "                ],\n",
       "                [\n",
       "                    20251.0,\n",
       "                    244.0\n",
       "                ],\n",
       "                [\n",
       "                    17136.0,\n",
       "                    168.0\n",
       "                ],\n",
       "                [\n",
       "                    16428.0,\n",
       "                    152.1\n",
       "                ],\n",
       "                [\n",
       "                    15244.0,\n",
       "                    148.0\n",
       "                ],\n",
       "                [\n",
       "                    14742.0,\n",
       "                    254.2\n",
       "                ],\n",
       "                [\n",
       "                    14622.0,\n",
       "                    155.6\n",
       "                ],\n",
       "                [\n",
       "                    13728.0,\n",
       "                    150.9\n",
       "                ],\n",
       "                [\n",
       "                    12826.0,\n",
       "                    144.1\n",
       "                ],\n",
       "                [\n",
       "                    12136.0,\n",
       "                    148.0\n",
       "                ],\n",
       "                [\n",
       "                    11592.0,\n",
       "                    18.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                3558446.0,\n",
       "                792685.0,\n",
       "                114452.0,\n",
       "                88144.0,\n",
       "                43870.0,\n",
       "                42636.0,\n",
       "                36617.0,\n",
       "                27966.0,\n",
       "                25032.0,\n",
       "                23376.0,\n",
       "                20251.0,\n",
       "                17136.0,\n",
       "                16428.0,\n",
       "                15244.0,\n",
       "                14742.0,\n",
       "                14622.0,\n",
       "                13728.0,\n",
       "                12826.0,\n",
       "                12136.0,\n",
       "                11592.0\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ]\n",
       "};\n",
       "                chart_0deecf960109499faa1d38af07c046d2.setOption(option_0deecf960109499faa1d38af07c046d2);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x21093fce5f8>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f1=Scatter(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "f1.add_xaxis(df_te_zheng[0:20].z_xse.tolist())\n",
    "f1.add_yaxis(\"商家A\",df_te_zheng[0:20].p_bdj.tolist())\n",
    "f1.set_global_opts(xaxis_opts=opts.AxisOpts(type_='value'))#注意pyechart的x轴通常默认为类别轴，需要重新设定为数值轴\n",
    "f1.set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "f1.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 平行坐标系\n",
    "\n",
    "* 平行坐标系是能够展示数据维度最自由的图形，但是最好对象不要太多\n",
    "\n",
    "* 注意平行坐标系的数据格式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "#官网例子\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Page, Parallel\n",
    "\n",
    "\n",
    "def parallel_base() -> Parallel:\n",
    "    data = [\n",
    "        [1, 91, 45, 125, 0.82, 34],\n",
    "        [2, 65, 27, 78, 0.86, 45],\n",
    "        [3, 83, 60, 84, 1.09, 73],\n",
    "        [4, 109, 81, 121, 1.28, 68],\n",
    "        [5, 106, 77, 114, 1.07, 55],\n",
    "        [6, 109, 81, 121, 1.28, 68],\n",
    "        [7, 106, 77, 114, 1.07, 55],\n",
    "        [8, 89, 65, 78, 0.86, 51, 26],\n",
    "        [9, 53, 33, 47, 0.64, 50, 17],\n",
    "        [10, 80, 55, 80, 1.01, 75, 24],\n",
    "        [11, 117, 81, 124, 1.03, 45],\n",
    "    ]\n",
    "    c = (\n",
    "        Parallel()\n",
    "        .add_schema(\n",
    "            [\n",
    "                {\"dim\": 0, \"name\": \"data\"},\n",
    "                {\"dim\": 1, \"name\": \"AQI\"},\n",
    "                {\"dim\": 2, \"name\": \"PM2.5\"},\n",
    "                {\"dim\": 3, \"name\": \"PM10\"},\n",
    "                {\"dim\": 4, \"name\": \"CO\"},\n",
    "                {\"dim\": 5, \"name\": \"NO2\"},\n",
    "            ]\n",
    "        )\n",
    "        .add(\"parallel\", data)\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"Parallel-基本示例\"))\n",
    "    )\n",
    "    return c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"8483a679a745465391456aaca9148a7c\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_8483a679a745465391456aaca9148a7c = echarts.init(\n",
       "                    document.getElementById('8483a679a745465391456aaca9148a7c'), 'white', {renderer: 'canvas'});\n",
       "                var option_8483a679a745465391456aaca9148a7c = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"parallel\",\n",
       "            \"coordinateSystem\": \"parallel\",\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"name\": \"parallel\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    1,\n",
       "                    91,\n",
       "                    45,\n",
       "                    125,\n",
       "                    0.82,\n",
       "                    34\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    65,\n",
       "                    27,\n",
       "                    78,\n",
       "                    0.86,\n",
       "                    45\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    83,\n",
       "                    60,\n",
       "                    84,\n",
       "                    1.09,\n",
       "                    73\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    109,\n",
       "                    81,\n",
       "                    121,\n",
       "                    1.28,\n",
       "                    68\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    106,\n",
       "                    77,\n",
       "                    114,\n",
       "                    1.07,\n",
       "                    55\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    109,\n",
       "                    81,\n",
       "                    121,\n",
       "                    1.28,\n",
       "                    68\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    106,\n",
       "                    77,\n",
       "                    114,\n",
       "                    1.07,\n",
       "                    55\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    89,\n",
       "                    65,\n",
       "                    78,\n",
       "                    0.86,\n",
       "                    51,\n",
       "                    26\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    53,\n",
       "                    33,\n",
       "                    47,\n",
       "                    0.64,\n",
       "                    50,\n",
       "                    17\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    80,\n",
       "                    55,\n",
       "                    80,\n",
       "                    1.01,\n",
       "                    75,\n",
       "                    24\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    117,\n",
       "                    81,\n",
       "                    124,\n",
       "                    1.03,\n",
       "                    45\n",
       "                ]\n",
       "            ],\n",
       "            \"smooth\": false\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"parallel\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"parallel\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"parallel\": {\n",
       "        \"left\": \"5%\",\n",
       "        \"right\": \"13%\",\n",
       "        \"bottom\": \"10%\",\n",
       "        \"top\": \"20%\"\n",
       "    },\n",
       "    \"parallelAxis\": [\n",
       "        {\n",
       "            \"dim\": 0,\n",
       "            \"name\": \"data\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 1,\n",
       "            \"name\": \"AQI\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 2,\n",
       "            \"name\": \"PM2.5\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 3,\n",
       "            \"name\": \"PM10\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 4,\n",
       "            \"name\": \"CO\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 5,\n",
       "            \"name\": \"NO2\"\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Parallel-\\u57fa\\u672c\\u793a\\u4f8b\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_8483a679a745465391456aaca9148a7c.setOption(option_8483a679a745465391456aaca9148a7c);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x165cb534668>"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "parallel_base().render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 利用商家的特征矩阵，做出排名前五的商家的平行坐标系，并基于适当的分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>nick</th>\n",
       "      <th>z_xse</th>\n",
       "      <th>z_num</th>\n",
       "      <th>p_sales</th>\n",
       "      <th>p_bdj</th>\n",
       "      <th>p_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>285</th>\n",
       "      <td>意尔康皮鞋旗舰店</td>\n",
       "      <td>3558446.0</td>\n",
       "      <td>289</td>\n",
       "      <td>47.8</td>\n",
       "      <td>257.4</td>\n",
       "      <td>485.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>284</th>\n",
       "      <td>意尔康男鞋旗舰店</td>\n",
       "      <td>792685.0</td>\n",
       "      <td>149</td>\n",
       "      <td>18.0</td>\n",
       "      <td>296.3</td>\n",
       "      <td>680.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>281</th>\n",
       "      <td>意尔康品牌店</td>\n",
       "      <td>114452.0</td>\n",
       "      <td>65</td>\n",
       "      <td>7.7</td>\n",
       "      <td>229.8</td>\n",
       "      <td>271.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161</th>\n",
       "      <td>乙方乙方88888</td>\n",
       "      <td>88144.0</td>\n",
       "      <td>9</td>\n",
       "      <td>60.3</td>\n",
       "      <td>162.3</td>\n",
       "      <td>164.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>吸引力xl</td>\n",
       "      <td>43870.0</td>\n",
       "      <td>5</td>\n",
       "      <td>59.0</td>\n",
       "      <td>148.7</td>\n",
       "      <td>152.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          nick      z_xse  z_num  p_sales  p_bdj  p_price\n",
       "285   意尔康皮鞋旗舰店  3558446.0    289     47.8  257.4    485.7\n",
       "284   意尔康男鞋旗舰店   792685.0    149     18.0  296.3    680.8\n",
       "281     意尔康品牌店   114452.0     65      7.7  229.8    271.5\n",
       "161  乙方乙方88888    88144.0      9     60.3  162.3    164.7\n",
       "197      吸引力xl    43870.0      5     59.0  148.7    152.0"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "z1=df_te_zheng.head(5)\n",
    "z1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[3558446.0, 289, 47.8, 257.4, 485.7]\n",
      "[792685.0, 149, 18.0, 296.3, 680.8]\n",
      "[114452.0, 65, 7.7, 229.8, 271.5]\n",
      "[88144.0, 9, 60.3, 162.3, 164.7]\n",
      "[43870.0, 5, 59.0, 148.7, 152.0]\n"
     ]
    }
   ],
   "source": [
    "for i in z1.iterrows():\n",
    "    print(i[1].tolist()[1:])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[3558446.0, 289, 47.8, 257.4, 485.7],\n",
       " [792685.0, 149, 18.0, 296.3, 680.8],\n",
       " [114452.0, 65, 7.7, 229.8, 271.5],\n",
       " [88144.0, 9, 60.3, 162.3, 164.7],\n",
       " [43870.0, 5, 59.0, 148.7, 152.0]]"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1=[]\n",
    "for i in z1.iterrows():\n",
    "    data1.append(i[1].tolist()[1:])\n",
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"230a6033145f49d2b08ed539780855cd\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_230a6033145f49d2b08ed539780855cd = echarts.init(\n",
       "                    document.getElementById('230a6033145f49d2b08ed539780855cd'), 'white', {renderer: 'canvas'});\n",
       "                var option_230a6033145f49d2b08ed539780855cd = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"parallel\",\n",
       "            \"coordinateSystem\": \"parallel\",\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"name\": \"parallel\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    3558446.0,\n",
       "                    289,\n",
       "                    47.8,\n",
       "                    257.4,\n",
       "                    485.7\n",
       "                ],\n",
       "                [\n",
       "                    792685.0,\n",
       "                    149,\n",
       "                    18.0,\n",
       "                    296.3,\n",
       "                    680.8\n",
       "                ],\n",
       "                [\n",
       "                    114452.0,\n",
       "                    65,\n",
       "                    7.7,\n",
       "                    229.8,\n",
       "                    271.5\n",
       "                ],\n",
       "                [\n",
       "                    88144.0,\n",
       "                    9,\n",
       "                    60.3,\n",
       "                    162.3,\n",
       "                    164.7\n",
       "                ],\n",
       "                [\n",
       "                    43870.0,\n",
       "                    5,\n",
       "                    59.0,\n",
       "                    148.7,\n",
       "                    152.0\n",
       "                ]\n",
       "            ],\n",
       "            \"smooth\": false\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"parallel\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"parallel\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"parallel\": {\n",
       "        \"left\": \"5%\",\n",
       "        \"right\": \"13%\",\n",
       "        \"bottom\": \"10%\",\n",
       "        \"top\": \"20%\"\n",
       "    },\n",
       "    \"parallelAxis\": [\n",
       "        {\n",
       "            \"dim\": 0,\n",
       "            \"name\": \"z_xse\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 1,\n",
       "            \"name\": \"z_num\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 2,\n",
       "            \"name\": \"p_sales\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 3,\n",
       "            \"name\": \"p_bdj\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 4,\n",
       "            \"name\": \"p_price\"\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Parallel-\\u57fa\\u672c\\u793a\\u4f8b\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_230a6033145f49d2b08ed539780855cd.setOption(option_230a6033145f49d2b08ed539780855cd);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x165cb488048>"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f2=Parallel().add_schema(\n",
    "            [\n",
    "                {\"dim\": 0, \"name\": \"z_xse\"},#注意这里的序号对应于data1中列表的索引\n",
    "                {\"dim\": 1, \"name\": \"z_num\"},\n",
    "                {\"dim\": 2, \"name\": \"p_sales\"},\n",
    "                {\"dim\": 3, \"name\": \"p_bdj\"},\n",
    "                {\"dim\": 4, \"name\": \"p_price\"},\n",
    "            ]\n",
    "        )\n",
    "f2.add(\"parallel\", data1)\n",
    "f2.set_global_opts(title_opts=opts.TitleOpts(title=\"Parallel-基本示例\"))\n",
    "f2.render_notebook()\n",
    "#头部两店铺差异化竞争\n",
    "#垄断店铺之外的商家生存之道"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 课后作业\n",
    "\n",
    "1，求排名3，4的商家的柱状图，两图并列，时间轮播图\n",
    "\n",
    "2  求 \"info.款式\"和“info.鞋面材质”对应的商品数量，做3d柱状图和热图\n",
    "\n",
    "3，求不同“info.鞋面材质”的商品的统计特征矩阵（具体统计包含，仿照商家特征建立，比如平均价格，大家自己设定几个）\n",
    "\n",
    "4，求“info.鞋面材质”两个特征下的散点图\n",
    "\n",
    "5，求排名前几的材质下特征矩阵的平行坐标系"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "te_zheng={\"nick\":[],\"z_xse\":[],\"z_num\":[],\"p_sales\":[],\"p_bdj\":[],\"p_price\":[]}\n",
    "for i in a1.groupby(\"info.鞋面材质\"):\n",
    "    te_zheng[\"nick\"].append(i[0])\n",
    "    te_zheng[\"z_xse\"].append(i[1].xse.sum())\n",
    "    te_zheng[\"z_num\"].append(len(i[1]))\n",
    "    te_zheng[\"p_sales\"].append(round(i[1].sales.mean(),1))\n",
    "    if i[1].sales.sum()==0:#存在除零的情况，所以做判断\n",
    "        te_zheng[\"p_bdj\"].append(0)\n",
    "    else:\n",
    "        te_zheng[\"p_bdj\"].append(round(i[1].xse.sum()/i[1].sales.sum(),1))\n",
    "    te_zheng[\"p_price\"].append(round(i[1].price.mean(),1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "#te_zheng"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>nick</th>\n",
       "      <th>z_xse</th>\n",
       "      <th>z_num</th>\n",
       "      <th>p_sales</th>\n",
       "      <th>p_bdj</th>\n",
       "      <th>p_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>头层牛皮（除牛反绒）</td>\n",
       "      <td>5344427.22</td>\n",
       "      <td>3470</td>\n",
       "      <td>6.4</td>\n",
       "      <td>239.0</td>\n",
       "      <td>321.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>二层牛皮（除牛反绒）</td>\n",
       "      <td>53818.40</td>\n",
       "      <td>605</td>\n",
       "      <td>0.6</td>\n",
       "      <td>158.3</td>\n",
       "      <td>212.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>多种材质拼接</td>\n",
       "      <td>37366.00</td>\n",
       "      <td>21</td>\n",
       "      <td>5.4</td>\n",
       "      <td>327.8</td>\n",
       "      <td>997.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>PU</td>\n",
       "      <td>18503.50</td>\n",
       "      <td>671</td>\n",
       "      <td>0.2</td>\n",
       "      <td>177.9</td>\n",
       "      <td>187.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>牛反绒</td>\n",
       "      <td>9223.00</td>\n",
       "      <td>12</td>\n",
       "      <td>3.0</td>\n",
       "      <td>256.2</td>\n",
       "      <td>200.7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          nick       z_xse  z_num  p_sales  p_bdj  p_price\n",
       "7   头层牛皮（除牛反绒）  5344427.22   3470      6.4  239.0    321.9\n",
       "1   二层牛皮（除牛反绒）    53818.40    605      0.6  158.3    212.3\n",
       "5       多种材质拼接    37366.00     21      5.4  327.8    997.0\n",
       "0           PU    18503.50    671      0.2  177.9    187.1\n",
       "12         牛反绒     9223.00     12      3.0  256.2    200.7"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_te_zheng=pd.DataFrame(te_zheng)\n",
    "df_te_zheng.sort_values(by=\"z_xse\",ascending=False,inplace=True)\n",
    "df_te_zheng.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/themes/purple-passion'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"c84fbc25355246c7b519958941d3e130\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion'], function(echarts) {\n",
       "                var chart_c84fbc25355246c7b519958941d3e130 = echarts.init(\n",
       "                    document.getElementById('c84fbc25355246c7b519958941d3e130'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_c84fbc25355246c7b519958941d3e130 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    5344427.22,\n",
       "                    239.0\n",
       "                ],\n",
       "                [\n",
       "                    53818.4,\n",
       "                    158.3\n",
       "                ],\n",
       "                [\n",
       "                    37366.0,\n",
       "                    327.8\n",
       "                ],\n",
       "                [\n",
       "                    18503.5,\n",
       "                    177.9\n",
       "                ],\n",
       "                [\n",
       "                    9223.0,\n",
       "                    256.2\n",
       "                ],\n",
       "                [\n",
       "                    6536.0,\n",
       "                    261.4\n",
       "                ],\n",
       "                [\n",
       "                    3430.0,\n",
       "                    98.0\n",
       "                ],\n",
       "                [\n",
       "                    2409.0,\n",
       "                    240.9\n",
       "                ],\n",
       "                [\n",
       "                    2311.0,\n",
       "                    154.1\n",
       "                ],\n",
       "                [\n",
       "                    2260.0,\n",
       "                    452.0\n",
       "                ],\n",
       "                [\n",
       "                    820.0,\n",
       "                    205.0\n",
       "                ],\n",
       "                [\n",
       "                    752.0,\n",
       "                    188.0\n",
       "                ],\n",
       "                [\n",
       "                    702.0,\n",
       "                    140.4\n",
       "                ],\n",
       "                [\n",
       "                    325.64,\n",
       "                    162.8\n",
       "                ],\n",
       "                [\n",
       "                    177.0,\n",
       "                    177.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ],\n",
       "                [\n",
       "                    0.0,\n",
       "                    0.0\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                5344427.22,\n",
       "                53818.4,\n",
       "                37366.0,\n",
       "                18503.5,\n",
       "                9223.0,\n",
       "                6536.0,\n",
       "                3430.0,\n",
       "                2409.0,\n",
       "                2311.0,\n",
       "                2260.0,\n",
       "                820.0,\n",
       "                752.0,\n",
       "                702.0,\n",
       "                325.64,\n",
       "                177.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                0.0,\n",
       "                0.0\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {}\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false\n",
       "    }\n",
       "};\n",
       "                chart_c84fbc25355246c7b519958941d3e130.setOption(option_c84fbc25355246c7b519958941d3e130);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x2109424f940>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f1=Scatter(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "f1.add_xaxis(df_te_zheng.z_xse.tolist())\n",
    "f1.add_yaxis(\"商家A\",df_te_zheng.p_bdj.tolist())\n",
    "f1.set_global_opts(xaxis_opts=opts.AxisOpts(type_='value'),datazoom_opts=opts.DataZoomOpts(is_show=True))#注意pyechart的x轴通常默认为类别轴，需要重新设定为数值轴\n",
    "f1.set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "f1.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>nick</th>\n",
       "      <th>z_xse</th>\n",
       "      <th>z_num</th>\n",
       "      <th>p_sales</th>\n",
       "      <th>p_bdj</th>\n",
       "      <th>p_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>头层牛皮（除牛反绒）</td>\n",
       "      <td>5344427.22</td>\n",
       "      <td>3470</td>\n",
       "      <td>6.4</td>\n",
       "      <td>239.0</td>\n",
       "      <td>321.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>二层牛皮（除牛反绒）</td>\n",
       "      <td>53818.40</td>\n",
       "      <td>605</td>\n",
       "      <td>0.6</td>\n",
       "      <td>158.3</td>\n",
       "      <td>212.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>多种材质拼接</td>\n",
       "      <td>37366.00</td>\n",
       "      <td>21</td>\n",
       "      <td>5.4</td>\n",
       "      <td>327.8</td>\n",
       "      <td>997.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>PU</td>\n",
       "      <td>18503.50</td>\n",
       "      <td>671</td>\n",
       "      <td>0.2</td>\n",
       "      <td>177.9</td>\n",
       "      <td>187.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>牛反绒</td>\n",
       "      <td>9223.00</td>\n",
       "      <td>12</td>\n",
       "      <td>3.0</td>\n",
       "      <td>256.2</td>\n",
       "      <td>200.7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          nick       z_xse  z_num  p_sales  p_bdj  p_price\n",
       "7   头层牛皮（除牛反绒）  5344427.22   3470      6.4  239.0    321.9\n",
       "1   二层牛皮（除牛反绒）    53818.40    605      0.6  158.3    212.3\n",
       "5       多种材质拼接    37366.00     21      5.4  327.8    997.0\n",
       "0           PU    18503.50    671      0.2  177.9    187.1\n",
       "12         牛反绒     9223.00     12      3.0  256.2    200.7"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "z1=df_te_zheng.head(5)\n",
    "z1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[5344427.22, 3470, 6.4, 239.0, 321.9],\n",
       " [53818.4, 605, 0.6, 158.3, 212.3],\n",
       " [37366.0, 21, 5.4, 327.8, 997.0],\n",
       " [18503.5, 671, 0.2, 177.9, 187.1],\n",
       " [9223.0, 12, 3.0, 256.2, 200.7]]"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1=[]\n",
    "for i in z1.iterrows():\n",
    "    data1.append(i[1].tolist()[1:])\n",
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d8d98e0469744523a851974b764e3dff\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_d8d98e0469744523a851974b764e3dff = echarts.init(\n",
       "                    document.getElementById('d8d98e0469744523a851974b764e3dff'), 'white', {renderer: 'canvas'});\n",
       "                var option_d8d98e0469744523a851974b764e3dff = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"parallel\",\n",
       "            \"coordinateSystem\": \"parallel\",\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"name\": \"parallel\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    5344427.22,\n",
       "                    3470,\n",
       "                    6.4,\n",
       "                    239.0,\n",
       "                    321.9\n",
       "                ],\n",
       "                [\n",
       "                    53818.4,\n",
       "                    605,\n",
       "                    0.6,\n",
       "                    158.3,\n",
       "                    212.3\n",
       "                ],\n",
       "                [\n",
       "                    37366.0,\n",
       "                    21,\n",
       "                    5.4,\n",
       "                    327.8,\n",
       "                    997.0\n",
       "                ],\n",
       "                [\n",
       "                    18503.5,\n",
       "                    671,\n",
       "                    0.2,\n",
       "                    177.9,\n",
       "                    187.1\n",
       "                ],\n",
       "                [\n",
       "                    9223.0,\n",
       "                    12,\n",
       "                    3.0,\n",
       "                    256.2,\n",
       "                    200.7\n",
       "                ]\n",
       "            ],\n",
       "            \"smooth\": false\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"parallel\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"parallel\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"parallel\": {\n",
       "        \"left\": \"5%\",\n",
       "        \"right\": \"13%\",\n",
       "        \"bottom\": \"10%\",\n",
       "        \"top\": \"20%\"\n",
       "    },\n",
       "    \"parallelAxis\": [\n",
       "        {\n",
       "            \"dim\": 0,\n",
       "            \"name\": \"z_xse\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 1,\n",
       "            \"name\": \"z_num\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 2,\n",
       "            \"name\": \"p_sales\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 3,\n",
       "            \"name\": \"p_bdj\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 4,\n",
       "            \"name\": \"p_price\"\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Parallel-\\u57fa\\u672c\\u793a\\u4f8b\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_d8d98e0469744523a851974b764e3dff.setOption(option_d8d98e0469744523a851974b764e3dff);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x165cb0f96a0>"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f2=Parallel().add_schema(\n",
    "            [\n",
    "                {\"dim\": 0, \"name\": \"z_xse\"},#注意这里的序号对应于data1中列表的索引\n",
    "                {\"dim\": 1, \"name\": \"z_num\"},\n",
    "                {\"dim\": 2, \"name\": \"p_sales\"},\n",
    "                {\"dim\": 3, \"name\": \"p_bdj\"},\n",
    "                {\"dim\": 4, \"name\": \"p_price\"},\n",
    "            ]\n",
    "        )\n",
    "f2.add(\"parallel\", data1)\n",
    "f2.set_global_opts(title_opts=opts.TitleOpts(title=\"Parallel-基本示例\"))\n",
    "f2.render_notebook()\n",
    "#头部两店铺差异化竞争\n",
    "#垄断店铺之外的商家生存之道"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "#先做成字典，把各个特征放入字典中\n",
    "te_zheng={\"nick\":[],\"z_xse\":[],\"z_num\":[],\"p_sales\":[],\"p_bdj\":[],\"p_price\":[]}\n",
    "for i in a1.groupby(\"info.鞋面材质\"):\n",
    "    te_zheng[\"nick\"].append(i[0])\n",
    "    te_zheng[\"z_xse\"].append(i[1].xse.sum())\n",
    "    te_zheng[\"z_num\"].append(len(i[1]))\n",
    "    te_zheng[\"p_sales\"].append(round(i[1].sales.mean(),1))\n",
    "    if i[1].sales.sum()==0:#存在除零的情况，所以做判断\n",
    "        te_zheng[\"p_bdj\"].append(0)\n",
    "    else:\n",
    "        te_zheng[\"p_bdj\"].append(round(i[1].xse.sum()/i[1].sales.sum(),1))\n",
    "    te_zheng[\"p_price\"].append(round(i[1].price.mean(),1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "#te_zheng"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>nick</th>\n",
       "      <th>z_xse</th>\n",
       "      <th>z_num</th>\n",
       "      <th>p_sales</th>\n",
       "      <th>p_bdj</th>\n",
       "      <th>p_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>头层牛皮（除牛反绒）</td>\n",
       "      <td>5344427.22</td>\n",
       "      <td>3470</td>\n",
       "      <td>6.4</td>\n",
       "      <td>239.0</td>\n",
       "      <td>321.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>二层牛皮（除牛反绒）</td>\n",
       "      <td>53818.40</td>\n",
       "      <td>605</td>\n",
       "      <td>0.6</td>\n",
       "      <td>158.3</td>\n",
       "      <td>212.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>多种材质拼接</td>\n",
       "      <td>37366.00</td>\n",
       "      <td>21</td>\n",
       "      <td>5.4</td>\n",
       "      <td>327.8</td>\n",
       "      <td>997.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>PU</td>\n",
       "      <td>18503.50</td>\n",
       "      <td>671</td>\n",
       "      <td>0.2</td>\n",
       "      <td>177.9</td>\n",
       "      <td>187.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>牛反绒</td>\n",
       "      <td>9223.00</td>\n",
       "      <td>12</td>\n",
       "      <td>3.0</td>\n",
       "      <td>256.2</td>\n",
       "      <td>200.7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          nick       z_xse  z_num  p_sales  p_bdj  p_price\n",
       "7   头层牛皮（除牛反绒）  5344427.22   3470      6.4  239.0    321.9\n",
       "1   二层牛皮（除牛反绒）    53818.40    605      0.6  158.3    212.3\n",
       "5       多种材质拼接    37366.00     21      5.4  327.8    997.0\n",
       "0           PU    18503.50    671      0.2  177.9    187.1\n",
       "12         牛反绒     9223.00     12      3.0  256.2    200.7"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_te_zheng=pd.DataFrame(te_zheng)\n",
    "df_te_zheng.sort_values(by=\"z_xse\",ascending=False,inplace=True)\n",
    "df_te_zheng.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>nick</th>\n",
       "      <th>z_xse</th>\n",
       "      <th>z_num</th>\n",
       "      <th>p_sales</th>\n",
       "      <th>p_bdj</th>\n",
       "      <th>p_price</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>头层牛皮（除牛反绒）</td>\n",
       "      <td>5344427.22</td>\n",
       "      <td>3470</td>\n",
       "      <td>6.4</td>\n",
       "      <td>239.0</td>\n",
       "      <td>321.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>二层牛皮（除牛反绒）</td>\n",
       "      <td>53818.40</td>\n",
       "      <td>605</td>\n",
       "      <td>0.6</td>\n",
       "      <td>158.3</td>\n",
       "      <td>212.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>多种材质拼接</td>\n",
       "      <td>37366.00</td>\n",
       "      <td>21</td>\n",
       "      <td>5.4</td>\n",
       "      <td>327.8</td>\n",
       "      <td>997.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>PU</td>\n",
       "      <td>18503.50</td>\n",
       "      <td>671</td>\n",
       "      <td>0.2</td>\n",
       "      <td>177.9</td>\n",
       "      <td>187.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>牛反绒</td>\n",
       "      <td>9223.00</td>\n",
       "      <td>12</td>\n",
       "      <td>3.0</td>\n",
       "      <td>256.2</td>\n",
       "      <td>200.7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          nick       z_xse  z_num  p_sales  p_bdj  p_price\n",
       "7   头层牛皮（除牛反绒）  5344427.22   3470      6.4  239.0    321.9\n",
       "1   二层牛皮（除牛反绒）    53818.40    605      0.6  158.3    212.3\n",
       "5       多种材质拼接    37366.00     21      5.4  327.8    997.0\n",
       "0           PU    18503.50    671      0.2  177.9    187.1\n",
       "12         牛反绒     9223.00     12      3.0  256.2    200.7"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "z1=df_te_zheng.head(5)\n",
    "z1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[5344427.22, 3470, 6.4, 239.0, 321.9],\n",
       " [53818.4, 605, 0.6, 158.3, 212.3],\n",
       " [37366.0, 21, 5.4, 327.8, 997.0],\n",
       " [18503.5, 671, 0.2, 177.9, 187.1],\n",
       " [9223.0, 12, 3.0, 256.2, 200.7]]"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1=[]\n",
    "for i in z1.iterrows():\n",
    "    data1.append(i[1].tolist()[1:])\n",
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"31f67482547f4e2c90150ce58fb3abe5\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_31f67482547f4e2c90150ce58fb3abe5 = echarts.init(\n",
       "                    document.getElementById('31f67482547f4e2c90150ce58fb3abe5'), 'white', {renderer: 'canvas'});\n",
       "                var option_31f67482547f4e2c90150ce58fb3abe5 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"parallel\",\n",
       "            \"coordinateSystem\": \"parallel\",\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"name\": \"parallel\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    5344427.22,\n",
       "                    3470,\n",
       "                    6.4,\n",
       "                    239.0,\n",
       "                    321.9\n",
       "                ],\n",
       "                [\n",
       "                    53818.4,\n",
       "                    605,\n",
       "                    0.6,\n",
       "                    158.3,\n",
       "                    212.3\n",
       "                ],\n",
       "                [\n",
       "                    37366.0,\n",
       "                    21,\n",
       "                    5.4,\n",
       "                    327.8,\n",
       "                    997.0\n",
       "                ],\n",
       "                [\n",
       "                    18503.5,\n",
       "                    671,\n",
       "                    0.2,\n",
       "                    177.9,\n",
       "                    187.1\n",
       "                ],\n",
       "                [\n",
       "                    9223.0,\n",
       "                    12,\n",
       "                    3.0,\n",
       "                    256.2,\n",
       "                    200.7\n",
       "                ]\n",
       "            ],\n",
       "            \"smooth\": false\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"parallel\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"parallel\": true\n",
       "            },\n",
       "            \"show\": true\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"parallel\": {\n",
       "        \"left\": \"5%\",\n",
       "        \"right\": \"13%\",\n",
       "        \"bottom\": \"10%\",\n",
       "        \"top\": \"20%\"\n",
       "    },\n",
       "    \"parallelAxis\": [\n",
       "        {\n",
       "            \"dim\": 0,\n",
       "            \"name\": \"z_xse\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 1,\n",
       "            \"name\": \"z_num\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 2,\n",
       "            \"name\": \"p_sales\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 3,\n",
       "            \"name\": \"p_bdj\"\n",
       "        },\n",
       "        {\n",
       "            \"dim\": 4,\n",
       "            \"name\": \"p_price\"\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Parallel-\\u57fa\\u672c\\u793a\\u4f8b\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_31f67482547f4e2c90150ce58fb3abe5.setOption(option_31f67482547f4e2c90150ce58fb3abe5);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x165cb6c30f0>"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f2=Parallel().add_schema(\n",
    "            [\n",
    "                {\"dim\": 0, \"name\": \"z_xse\"},#注意这里的序号对应于data1中列表的索引\n",
    "                {\"dim\": 1, \"name\": \"z_num\"},\n",
    "                {\"dim\": 2, \"name\": \"p_sales\"},\n",
    "                {\"dim\": 3, \"name\": \"p_bdj\"},\n",
    "                {\"dim\": 4, \"name\": \"p_price\"},\n",
    "            ]\n",
    "        )\n",
    "f2.add(\"parallel\", data1)\n",
    "f2.set_global_opts(title_opts=opts.TitleOpts(title=\"Parallel-基本示例\"))\n",
    "f2.render_notebook()\n",
    "#头部两店铺差异化竞争\n",
    "#垄断店铺之外的商家生存之道"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
